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

google_compute_instance boot_disk does not support disk self_url #610

Closed
migibert opened this issue Oct 20, 2017 · 2 comments
Closed

google_compute_instance boot_disk does not support disk self_url #610

migibert opened this issue Oct 20, 2017 · 2 comments

Comments

@migibert
Copy link
Contributor

Hi,

When I try to explicitly define a disk for an instance, and reference it using ${google_compute_disk.mydisk.self_link}

Terraform version : 0.10.6
Provider version : 1.1.0

Here is a sample file to reproduce the case.

resource "google_compute_disk" "test" {
  name  = "test"
  type  = "pd-standard"
  zone  = "europe-west1-d"
  image = "debian-cloud/debian-8"
}

resource "google_compute_instance" "test" {
  name         = "test"
  machine_type = "n1-standard-1"
  zone         = "europe-west1-d"

  boot_disk {
    source = "${google_compute_disk.test.self_link}"
  }

  network_interface {
    network = "default"
    access_config {
    }
  }
}

And the error message is

Error applying plan:

1 error(s) occurred:

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

Replacing the disk self_link by the disk name works but the documentation at https://www.terraform.io/docs/providers/google/r/compute_instance.html#source-1 explicitly says

source - (Required) The self_link of the disk to attach to this instance.

@danawillow
Copy link
Contributor

Hey @migibert, you're looking at the source documentation for attached_disk. The boot_disk one is https://www.terraform.io/docs/providers/google/r/compute_instance.html#source, which does say it's the name.

Conveniently, #605 is making both versions valid so I'm going to go ahead and close this issue. Thanks though!

luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this issue May 21, 2019
Signed-off-by: Modular Magician <magic-modules@google.com>
@ghost
Copy link

ghost commented Mar 30, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

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

No branches or pull requests

2 participants