-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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/aws: Conflict between "ipv6_address_count" and "ipv6_addresses" which forces new resource #14032
Comments
Hi @sandnabba Thanks for reporting this bug - I can confirm that I have been able to recreate it:
A patch I am working on now does the following as a plan:
This will be included in the Terraform 0.9.5 release Thanks Paul |
Fixes: #14032 When you are using an IPv6 address directly to an instance, it was causing the ipv6_address_count to try and ForceNew resource. It wasn't marked as computed I was able to see this here: ``` -/+ aws_instance.test ami: "ami-c5eabbf5" => "ami-c5eabbf5" associate_public_ip_address: "false" => "<computed>" availability_zone: "us-west-2a" => "<computed>" ebs_block_device.#: "0" => "<computed>" ephemeral_block_device.#: "0" => "<computed>" instance_state: "running" => "<computed>" instance_type: "t2.micro" => "t2.micro" ipv6_address_count: "1" => "0" (forces new resource) ipv6_addresses.#: "1" => "1" ipv6_addresses.0: "2600:1f14:bb2:e501::10" => "2600:1f14:bb2:e501::10" key_name: "" => "<computed>" network_interface.#: "0" => "<computed>" network_interface_id: "eni-d19115ec" => "<computed>" placement_group: "" => "<computed>" primary_network_interface_id: "eni-d19115ec" => "<computed>" private_dns: "ip-10-20-1-252.us-west-2.compute.internal" => "<computed>" private_ip: "10.20.1.252" => "<computed>" public_dns: "" => "<computed>" public_ip: "" => "<computed>" root_block_device.#: "1" => "<computed>" security_groups.#: "0" => "<computed>" source_dest_check: "true" => "true" subnet_id: "subnet-3fdfb476" => "subnet-3fdfb476" tags.%: "1" => "1" tags.Name: "stack72" => "stack72" tenancy: "default" => "<computed>" volume_tags.%: "0" => "<computed>" vpc_security_group_ids.#: "1" => "<computed>" ``` It now works as expected: ``` % terraform plan ✹ ✭ [WARN] /Users/stacko/Code/go/bin/terraform-provider-aws overrides an internal plugin for aws-provider. If you did not expect to see this message you will need to remove the old plugin. See https://www.terraform.io/docs/internals/internal-plugins.html Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_vpc.foo: Refreshing state... (ID: vpc-fa61669d) aws_subnet.foo: Refreshing state... (ID: subnet-3fdfb476) aws_internet_gateway.foo: Refreshing state... (ID: igw-70629a17) aws_route_table.test: Refreshing state... (ID: rtb-0a52e16c) aws_instance.test: Refreshing state... (ID: i-0971755345296aca5) aws_route_table_association.a: Refreshing state... (ID: rtbassoc-b12493c8) No changes. Infrastructure is up-to-date. This means that Terraform did not detect any differences between your configuration and real physical resources that exist. As a result, Terraform doesn't need to do anything. ```
Fixes: #14032 When you are using an IPv6 address directly to an instance, it was causing the ipv6_address_count to try and ForceNew resource. It wasn't marked as computed I was able to see this here: ``` -/+ aws_instance.test ami: "ami-c5eabbf5" => "ami-c5eabbf5" associate_public_ip_address: "false" => "<computed>" availability_zone: "us-west-2a" => "<computed>" ebs_block_device.#: "0" => "<computed>" ephemeral_block_device.#: "0" => "<computed>" instance_state: "running" => "<computed>" instance_type: "t2.micro" => "t2.micro" ipv6_address_count: "1" => "0" (forces new resource) ipv6_addresses.#: "1" => "1" ipv6_addresses.0: "2600:1f14:bb2:e501::10" => "2600:1f14:bb2:e501::10" key_name: "" => "<computed>" network_interface.#: "0" => "<computed>" network_interface_id: "eni-d19115ec" => "<computed>" placement_group: "" => "<computed>" primary_network_interface_id: "eni-d19115ec" => "<computed>" private_dns: "ip-10-20-1-252.us-west-2.compute.internal" => "<computed>" private_ip: "10.20.1.252" => "<computed>" public_dns: "" => "<computed>" public_ip: "" => "<computed>" root_block_device.#: "1" => "<computed>" security_groups.#: "0" => "<computed>" source_dest_check: "true" => "true" subnet_id: "subnet-3fdfb476" => "subnet-3fdfb476" tags.%: "1" => "1" tags.Name: "stack72" => "stack72" tenancy: "default" => "<computed>" volume_tags.%: "0" => "<computed>" vpc_security_group_ids.#: "1" => "<computed>" ``` It now works as expected: ``` % terraform plan ✹ ✭ [WARN] /Users/stacko/Code/go/bin/terraform-provider-aws overrides an internal plugin for aws-provider. If you did not expect to see this message you will need to remove the old plugin. See https://www.terraform.io/docs/internals/internal-plugins.html Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_vpc.foo: Refreshing state... (ID: vpc-fa61669d) aws_subnet.foo: Refreshing state... (ID: subnet-3fdfb476) aws_internet_gateway.foo: Refreshing state... (ID: igw-70629a17) aws_route_table.test: Refreshing state... (ID: rtb-0a52e16c) aws_instance.test: Refreshing state... (ID: i-0971755345296aca5) aws_route_table_association.a: Refreshing state... (ID: rtbassoc-b12493c8) No changes. Infrastructure is up-to-date. This means that Terraform did not detect any differences between your configuration and real physical resources that exist. As a result, Terraform doesn't need to do anything. ```
Fixes: hashicorp#14032 When you are using an IPv6 address directly to an instance, it was causing the ipv6_address_count to try and ForceNew resource. It wasn't marked as computed I was able to see this here: ``` -/+ aws_instance.test ami: "ami-c5eabbf5" => "ami-c5eabbf5" associate_public_ip_address: "false" => "<computed>" availability_zone: "us-west-2a" => "<computed>" ebs_block_device.#: "0" => "<computed>" ephemeral_block_device.#: "0" => "<computed>" instance_state: "running" => "<computed>" instance_type: "t2.micro" => "t2.micro" ipv6_address_count: "1" => "0" (forces new resource) ipv6_addresses.#: "1" => "1" ipv6_addresses.0: "2600:1f14:bb2:e501::10" => "2600:1f14:bb2:e501::10" key_name: "" => "<computed>" network_interface.#: "0" => "<computed>" network_interface_id: "eni-d19115ec" => "<computed>" placement_group: "" => "<computed>" primary_network_interface_id: "eni-d19115ec" => "<computed>" private_dns: "ip-10-20-1-252.us-west-2.compute.internal" => "<computed>" private_ip: "10.20.1.252" => "<computed>" public_dns: "" => "<computed>" public_ip: "" => "<computed>" root_block_device.#: "1" => "<computed>" security_groups.#: "0" => "<computed>" source_dest_check: "true" => "true" subnet_id: "subnet-3fdfb476" => "subnet-3fdfb476" tags.%: "1" => "1" tags.Name: "stack72" => "stack72" tenancy: "default" => "<computed>" volume_tags.%: "0" => "<computed>" vpc_security_group_ids.#: "1" => "<computed>" ``` It now works as expected: ``` % terraform plan ✹ ✭ [WARN] /Users/stacko/Code/go/bin/terraform-provider-aws overrides an internal plugin for aws-provider. If you did not expect to see this message you will need to remove the old plugin. See https://www.terraform.io/docs/internals/internal-plugins.html Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage. aws_vpc.foo: Refreshing state... (ID: vpc-fa61669d) aws_subnet.foo: Refreshing state... (ID: subnet-3fdfb476) aws_internet_gateway.foo: Refreshing state... (ID: igw-70629a17) aws_route_table.test: Refreshing state... (ID: rtb-0a52e16c) aws_instance.test: Refreshing state... (ID: i-0971755345296aca5) aws_route_table_association.a: Refreshing state... (ID: rtbassoc-b12493c8) No changes. Infrastructure is up-to-date. This means that Terraform did not detect any differences between your configuration and real physical resources that exist. As a result, Terraform doesn't need to do anything. ```
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. |
Hello,
I'm trying to add an AWS instance with a static IPv6 address. This fails because Terraform want the "ipv6_address_count" to be 0, and consequently recreates the instance at each apply.
Terraform Version
Terraform v0.9.4
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
After
terraform apply
,terraform plan
should report "No changes. Infrastructure is up-to-date"Actual Behavior
Terraform plan reports:
If I add "ipv6_address_count = 1" to the configuration,
terraform plan
fails with:Steps to Reproduce
terraform apply
terraform plan
Related
The text was updated successfully, but these errors were encountered: