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

SetNewCompute ipv6 attrs in vpc when added #8181

Closed
wants to merge 1 commit into from

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Apr 3, 2019

If assign_generated_ipv6_block changes in a vpc, the diff has to reflect
that the ipv6 attrs are going to change.

As is often the case, diffs didn't match during apply (soon to be Provider produced inconsistent final plan) errors are caused by an upstream dependency. Here, a resource referencing the generated ipv6_cidr_block will get the incorrect value if it changes during apply.

Fixes #6710

$ TF_ACC=1 go test -v -run TestAccAWSVpc_AssignGeneratedIpv6CidrBlockFromFalse
=== RUN   TestAccAWSVpc_AssignGeneratedIpv6CidrBlockFromFalse
=== PAUSE TestAccAWSVpc_AssignGeneratedIpv6CidrBlockFromFalse
=== CONT  TestAccAWSVpc_AssignGeneratedIpv6CidrBlockFromFalse
--- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlockFromFalse (50.95s)
PASS

If assign_generated_ipv6_block changes in a vpc, the diff has to reflect
that the ipv6 attrs are going to change.
@jbardin jbardin requested a review from bflad April 3, 2019 23:05
@ghost ghost added size/S Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 3, 2019
@bflad
Copy link
Contributor

bflad commented Apr 3, 2019

Hmm this appears related to #6721, but I had tagged it to wait until after the 0.12 SDK was merged in. Let me try to remember why.

@jbardin
Copy link
Member Author

jbardin commented Apr 3, 2019

Oh, I missed that one, I only saw the upstream PR. I was in the area testing a recent SDK change, and thought I commit this update, but take whichever you prefer 👍

@bflad
Copy link
Contributor

bflad commented Apr 3, 2019

Ah yes, because the Terraform Provider SDK change was never backported to v0.11, so we don't want to merge failing testing:

--- FAIL: TestAccAWSVpc_AssignGeneratedIpv6CidrBlockFromFalse (33.74s)
    testing.go:538: Step 1 error: Error applying: 1 error occurred:
        	* aws_network_acl_rule.egress_internal_ipv6: aws_network_acl_rule.egress_internal_ipv6: diffs didn't match during apply. This is a bug with Terraform and should be reported as a GitHub Issue.

        Please include the following information in your report:

            Terraform Version: 0.11.14
            Resource ID: aws_network_acl_rule.egress_internal_ipv6
            Mismatch reason: extra attributes: ipv6_cidr_block
            Diff One (usually from plan): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"egress":*terraform.ResourceAttrDiff{Old:"", New:"true", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "from_port":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "network_acl_id":*terraform.ResourceAttrDiff{Old:"", New:"acl-00b2b660f3e1ac6a2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "protocol":*terraform.ResourceAttrDiff{Old:"", New:"-1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "rule_action":*terraform.ResourceAttrDiff{Old:"", New:"allow", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "rule_number":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "to_port":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}
            Diff Two (usually from apply): *terraform.InstanceDiff{mu:sync.Mutex{state:0, sema:0x0}, Attributes:map[string]*terraform.ResourceAttrDiff{"egress":*terraform.ResourceAttrDiff{Old:"", New:"true", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "from_port":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "ipv6_cidr_block":*terraform.ResourceAttrDiff{Old:"", New:"2600:1f14:9d7:4900::/56", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "network_acl_id":*terraform.ResourceAttrDiff{Old:"", New:"acl-00b2b660f3e1ac6a2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "protocol":*terraform.ResourceAttrDiff{Old:"", New:"-1", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "rule_action":*terraform.ResourceAttrDiff{Old:"", New:"allow", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "rule_number":*terraform.ResourceAttrDiff{Old:"", New:"2", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}, "to_port":*terraform.ResourceAttrDiff{Old:"", New:"0", NewComputed:false, NewRemoved:false, NewExtra:interface {}(nil), RequiresNew:true, Sensitive:false, Type:0x0}}, Destroy:false, DestroyDeposed:false, DestroyTainted:false, Meta:map[string]interface {}(nil)}

        Also include as much context as you can about your config, state, and the steps you performed to trigger this error.

@bflad bflad added this to the 0.12-post-support milestone Apr 3, 2019
@jbardin
Copy link
Member Author

jbardin commented Apr 3, 2019

Looks like this is nearly identical. I'll leave the existing PR for merging later.

@jbardin jbardin closed this Apr 3, 2019
@jbardin jbardin deleted the jbardin/vpc-ipv6-diff branch April 5, 2019 15:22
@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. 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
service/ec2 Issues and PRs that pertain to the ec2 service. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

After modifying VPC to assign IPv6, using ipv6_cidr_block causes failure
2 participants