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

Compute instance missing external IPv6 address output attribute #11918

Assignees
Labels

Comments

@espes
Copy link

espes commented Jun 19, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.2.3
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v4.25.0

Affected Resource(s)

  • google_compute_instance

Terraform Configuration Files

provider "google" {
  region  = "europe-west2"
}

resource "google_compute_network" "network" {
  name = "demo-net"
  auto_create_subnetworks = false
}

resource "google_compute_subnetwork" "subnet" {
  name = "demo-subnet"
  network = google_compute_network.network.id
  ip_cidr_range = "10.1.0.0/20"
  stack_type = "IPV4_IPV6"
  ipv6_access_type = "EXTERNAL"
}

resource "google_compute_instance" "instance" {
  name         = "server"
  machine_type = "f1-micro"
  zone         = "europe-west2-a"

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

  network_interface {
    network = google_compute_network.network.id
    subnetwork = google_compute_subnetwork.subnet.id
    access_config {
      network_tier = "PREMIUM"
    }
    stack_type = "IPV4_IPV6"
    ipv6_access_config {
      network_tier = "PREMIUM"
    }
  }
}

Debug Output

https://gist.github.com/espes/71be84b987f04421398c968c1459434a

Expected Behavior

The network_interface.0.ipv6_access_config.0.external_ipv6 property is populated with the IPv6 address of the instance

Actual Behavior

external_ipv6 is not populated. Notably, the ipv6 address is visible in networkInterfaces.ipv6AccessConfigs when running gcloud compute instances describe server, and in the API output in the debug log

Steps to Reproduce

  1. terraform apply
  2. terraform state show google_compute_instance.instance
  3. Observe the ipv6_access_config block does not contain the external_ipv6 field

I'm not an expert on provider internals, but comparing the flattenIpv6AccessConfigs method to the equivalent flattenAccessConfigs method seems suspect: https://github.com/hashicorp/terraform-provider-google/blob/main/google/compute_instance_helpers.go#L171

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.