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

Private and public IP addresses not available in the statefile. #543

Closed
anas-aso opened this issue Oct 6, 2017 · 4 comments
Closed

Private and public IP addresses not available in the statefile. #543

anas-aso opened this issue Oct 6, 2017 · 4 comments

Comments

@anas-aso
Copy link

anas-aso commented Oct 6, 2017

Terraform Version

$ terraform -v
Terraform v0.10.6

Affected Resource(s)

  • google_compute_instance

Terraform Configuration Files

resource "google_compute_instance" "default" {
  name         = "test"
  machine_type = "n1-standard-1"
  zone         = "us-central1-a"

  boot_disk {
    initialize_params {
      image = "debian-cloud/debian-8"
    }
  }

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

output "private_ip" {
  value = "${google_compute_instance.default.network_interface.0.address}"
}

output "public_ip" {
  value = "${google_compute_instance.default.network_interface.0.access_config.0.assigned_nat_ip}"
}

Expected Behavior

Get the private and public IPs of the created instance.

Actual Behavior

Nothing is printed, and when I checked the statefile I found something like the following:

[...]
     "network_interface.0.access_config.0.assigned_nat_ip": "",
     "network_interface.0.access_config.0.nat_ip": "<the correct public IP>",
     "network_interface.0.address": "",
[...]

Steps to Reproduce

  1. terraform apply
  2. open the statefile to check that network_interface.0.address and network_interface.0.access_config.0.assigned_nat_ip are not set.
@anas-aso anas-aso changed the title Private IP address not available in the statefile. Private and public IP addresses not available in the statefile. Oct 6, 2017
@danawillow
Copy link
Contributor

This looks like a duplicate of #519 so closing in favor of that (let me know if I'm wrong!)

@anas-aso
Copy link
Author

anas-aso commented Oct 6, 2017

sorry @danawillow for duplicating the issue. I didn't manage to find it myself 😄

@danawillow
Copy link
Contributor

no worries!

luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this issue May 21, 2019
Add note about sensitive content to gcs bucket object
@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants