terraform-provider-aws: EIP scope change incorrectly detected
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
Terraform Version
$ terraform version
Terraform v0.11.7
+ provider.aws v1.28.0
Affected Resource(s)
-/+ aws_eip.sandbox_infrastructure_zappi_it_us_east_1b (new resource required)
id: "eipalloc-8b296e83" => <computed> (forces new resource)
allocation_id: "" => <computed>
association_id: "" => <computed>
domain: "standard" => <computed>
instance: "i-ac10f68c" => <computed>
network_interface: "" => <computed>
private_ip: "" => <computed>
public_ip: "23.21.180.181" => <computed>
tags.%: "0" => "4"
tags.Environment: "" => "sandbox"
tags.Infrastructure: "" => "kubernetes"
tags.Name: "" => "us-east-1b.sandbox.infrastructure.zappi.it"
tags.Role: "" => "operations"
vpc: "false" => "true" (forces new resource)
Terraform Configuration Files
resource "aws_eip" "sandbox_infrastructure_zappi_it_us_east_1b" {
vpc = true
depends_on = [
"aws_internet_gateway.sandbox_infrastructure_zappi_it"
]
tags = {
Name = "us-east-1b.sandbox.infrastructure.zappi.it"
Environment = "sandbox"
Infrastructure = "kubernetes"
Role = "operations"
}
}
Debug Output
Expected Behavior
Terraform should not incorrectly detect that the VPC scope has changed when it has not, as per the screenshot below:

Actual Behavior
Terraform incorrectly detects that the VPC scope has changed from false to true.
The example above was not the first incident, but just a more concrete example. Below is the first case we identified:
-/+ aws_eip.us-east-1b-uat-kubernetes-zappi-it (new resource required)
id: "eipalloc-855eacb4" => <computed> (forces new resource)
allocation_id: "" => <computed>
association_id: "" => <computed>
domain: "standard" => <computed>
instance: "i-ac10f68c" => <computed>
network_interface: "" => <computed>
private_ip: "" => <computed>
public_ip: "23.21.180.181" => <computed>
tags.%: "0" => "3"
tags.KubernetesCluster: "" => "uat.kubernetes.zappi.it"
tags.Name: "" => "us-east-1b.uat.kubernetes.zappi.it"
tags.kubernetes.io/cluster/uat.kubernetes.zappi.it: "" => "owned"
vpc: "false" => "true" (forces new resource)
-/+ aws_nat_gateway.us-east-1b-uat-kubernetes-zappi-it (new resource required)
id: "nat-050bee284fbf24f25" => <computed> (forces new resource)
allocation_id: "eipalloc-855eacb4" => "${aws_eip.us-east-1b-uat-kubernetes-zappi-it.id}" (forces new resource)
network_interface_id: "eni-8ff31264" => <computed>
private_ip: "10.81.2.116" => <computed>
public_ip: "34.193.141.134" => <computed>
subnet_id: "subnet-68d74754" => "subnet-68d74754"
tags.%: "3" => "3"
tags.KubernetesCluster: "uat.kubernetes.zappi.it" => "uat.kubernetes.zappi.it"
tags.Name: "us-east-1b.uat.kubernetes.zappi.it" => "us-east-1b.uat.kubernetes.zappi.it"
tags.kubernetes.io/cluster/uat.kubernetes.zappi.it: "owned" => "owned"
~ aws_route.private-us-east-1b-0-0-0-0--0
nat_gateway_id: "nat-050bee284fbf24f25" => "${aws_nat_gateway.us-east-1b-uat-kubernetes-zappi-it.id}"
Error during apply:
Applying uat terraform plan...
aws_nat_gateway.us-east-1b-uat-kubernetes-zappi-it: Destroying... (ID: nat-050bee284fbf24f25)
aws_nat_gateway.us-east-1b-uat-kubernetes-zappi-it: Still destroying... (ID: nat-050bee284fbf24f25, 10s elapsed)
aws_nat_gateway.us-east-1b-uat-kubernetes-zappi-it: Still destroying... (ID: nat-050bee284fbf24f25, 20s elapsed)
aws_nat_gateway.us-east-1b-uat-kubernetes-zappi-it: Still destroying... (ID: nat-050bee284fbf24f25, 30s elapsed)
aws_nat_gateway.us-east-1b-uat-kubernetes-zappi-it: Still destroying... (ID: nat-050bee284fbf24f25, 40s elapsed)
aws_nat_gateway.us-east-1b-uat-kubernetes-zappi-it: Still destroying... (ID: nat-050bee284fbf24f25, 50s elapsed)
aws_nat_gateway.us-east-1b-uat-kubernetes-zappi-it: Destruction complete after 50s
aws_eip.us-east-1b-uat-kubernetes-zappi-it: Destroying... (ID: eipalloc-855eacb4)
Error: Error applying plan:
1 error(s) occurred:
* aws_eip.us-east-1b-uat-kubernetes-zappi-it (destroy): 1 error(s) occurred:
* aws_eip.us-east-1b-uat-kubernetes-zappi-it: InvalidParameterValue: Invalid value 'eipalloc-855eacb4' for PublicIp. Not a valid IPv4 address.
status code: 400, request id: 9a2c55d3-aa28-4503-b4f0-51e607f5dd07
This behaviour started today at ~08:45 AM UTC for 1 of 3 availability zones for one environment initially.
However, in subsequent terraform plan executions a few minutes later, all of our environments are now affected.
Steps to Reproduce
We use the following during our CI runs:
terraform initterraform plan -no-color --out="${environment}.plan" | tee "${environment}.report"terraform apply "${environment}.plan"
Donโt have an isolated reproducible case yet, but will provide if necessary.
Important Factoids
Running in VPC. Terraform is run in CI.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 10
- Comments: 16 (4 by maintainers)
@rv-aburdine certainly wouldnโt hurt!
Terraform Plan (DEBUG)
Request
Note the allocation ID above:
eipalloc-de3a31d6Response
Note the allocation ID
eipalloc-de3a31d6is returned, but itโs the last element in the response XML. Note the first element in the response XML is IP23.21.219.184Plan Output
Note the
public_ipproperty is showing a current value of23.21.219.184โ the first element in the ec2/DescribeAddresses response.AWS CLI
After executing the AWS CLI command several times, I was able to get one correct response:
This seems to indicate there is a rollout in progress.