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

output not working with Terraform 10 #595

Closed
hashibot opened this issue Oct 17, 2017 · 3 comments
Closed

output not working with Terraform 10 #595

hashibot opened this issue Oct 17, 2017 · 3 comments

Comments

@hashibot
Copy link

This issue was originally opened by @jegadeshhike as hashicorp/terraform#16317. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform v0.9.11

Code:

resource "google_compute_instance" "nomad" {
 count = 1 
    zone  = "asia-southeast1-a"

 name = "nomad-${count.index}"
 machine_type = "n1-standard-2"
 disk {
    image = "ubuntu-1404-trusty-v20170918"
 }
 network_interface {
   network = "default"
   access_config {
   }
 }
}

output "masterip" {
 value = "${google_compute_instance.nomad.*.network_interface.0.address}"
}
output "externalip" {
 value = "${google_compute_instance.nomad.*.network_interface.0.access_config.0.assigned_nat_ip}"
}

Result : 

Outputs:

externalip = [
    3*.*.236.242
]
masterip = [
    10.*.*.2
]

"Terraform '0.10.7'"

resource "google_compute_disk" "nomad-disk" {
    name  = "nomad-disk1"
    zone  = "asia-southeast1-a"
    type  = "pd-ssd"
    image = "ubuntu-1404-trusty-v20170918"
    size = 10
}

resource "google_compute_instance" "nomad" {
 count = 1
    zone  = "asia-southeast1-a"

 name = "nomad-${count.index}"
 machine_type = "n1-standard-2"
 boot_disk {
       source = "${google_compute_disk.nomad-disk.id}"
 }
 network_interface {
   network = "default"
   access_config {
   }
 }
}

output "masterip" {
 value = "${google_compute_instance.nomad.*.network_interface.0.address}"
}
output "externalip" {
 value = "${google_compute_instance.nomad.*.network_interface.0.access_config.0.assigned_nat_ip}"
}


Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

externalip = [
]
masterip = [
]
@danawillow
Copy link
Contributor

I think this is the same issue as #519, which was fixed in the latest release. @jegadeshhike are you using version 1.1.0 of the google provider?

@rosbo
Copy link
Contributor

rosbo commented Jan 10, 2018

This issue should be fixed now. Feel free to reopen this issue if you are still having trouble after updating the google terraform provider to the latest version.

@rosbo rosbo closed this as completed Jan 10, 2018
@rosbo rosbo self-assigned this Jan 11, 2018
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this issue May 21, 2019
@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 👉 [email protected]. 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.
Projects
None yet
Development

No branches or pull requests

4 participants