Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/google: enable use of URI as snapshot name when creating a disk #14774

Merged
merged 7 commits into from
May 23, 2017

Conversation

paddycarver
Copy link
Contributor

Hi

It's possible to create a disk in a Google project A from a snapshot made in project B. But to do this, you need to use URI of the snapshot in project B.

This PR enable this usage.

I tested it :

  • I made a snapshot of a disk in project A (named "snapshot-1")
  • I used terraform to create a disk in project B, using the snapshot.
resource "google_compute_disk" "default" {
  name  = "test-disk-gbook"
  type  = "pd-ssd"
  zone  = "europe-west1-d"
  snapshot = "https://www.googleapis.com/compute/v1/projects/sk5-formations-thomas-build/global/snapshots/snapshot-1"
}

Thanks.

Thomas


This PR was originally #12278, but due to some git shenanigans, that PR became unusable, so it has been moved here. It was originally opened by @tpoindessous, who remains the shepherd and author of it, no matter what GitHub says. :)

tpoindessous and others added 6 commits May 22, 2017 22:51
GOOGLE_COMPUTE_DISK_SNAPSHOT_URI must be set to a valid snapshot's uri like one of the output of
gcloud compute snapshots list --uri

GOOGLE_COMPUTE_DISK_SNAPSHOT_URI should be replaced by a proper snapshot made by TF (#11690)
We no longer need to set an env var (yaaay!) and our test names use
camelCase not snake_case, though that confusion is understandable.
@paddycarver
Copy link
Contributor Author

The code looks good to me. I made minor changes to the naming of the test functions and removed the check for the environment variable that's no longer being used. Tests still pass and changes are stylistic in nature, so merging this now. :) Great work @tpoindessous, thanks so much for contributing this back to Terraform!

@ghost
Copy link

ghost commented Apr 11, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants