You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to extend our common module for vpc definition to optionally include ipv6 support. To do that, I must associate an ipv6 cidr block with the vpc and then sub-blocks with each subnet. I tried using a ternary construct to conditionally associate the subnet blocks, but terraform is fully evaluating the un-taken branch of the ternary, which then fails due to the vpc not having an ipv6_cidr_block attribute.
It seems the only way I could make this work is by always associating an ipv6 cidr block to the vpc, whether I want it or not, and then the conditional would correctly evaluate for the subnets. That's not the end of the world, but it prevents this work gracefully handling existing vpcs that don't require ipv6. And that's because of #13588 which makes turning ipv6 on a highly manual process.
For example:
* module.networking.aws_subnet.public_subnet: 3 error(s) occurred:
* module.networking.aws_subnet.public_subnet[1]: Resource 'aws_vpc.vpc' does not have attribute 'ipv6_cidr_block' for variable 'aws_vpc.vpc.ipv6_cidr_block'
* module.networking.aws_subnet.public_subnet[2]: Resource 'aws_vpc.vpc' does not have attribute 'ipv6_cidr_block' for variable 'aws_vpc.vpc.ipv6_cidr_block'
* module.networking.aws_subnet.public_subnet[0]: Resource 'aws_vpc.vpc' does not have attribute 'ipv6_cidr_block' for variable 'aws_vpc.vpc.ipv6_cidr_block'
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.
ghost
locked and limited conversation to collaborators
Apr 9, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am attempting to extend our common module for vpc definition to optionally include ipv6 support. To do that, I must associate an ipv6 cidr block with the vpc and then sub-blocks with each subnet. I tried using a ternary construct to conditionally associate the subnet blocks, but terraform is fully evaluating the un-taken branch of the ternary, which then fails due to the vpc not having an ipv6_cidr_block attribute.
It seems the only way I could make this work is by always associating an ipv6 cidr block to the vpc, whether I want it or not, and then the conditional would correctly evaluate for the subnets. That's not the end of the world, but it prevents this work gracefully handling existing vpcs that don't require ipv6. And that's because of #13588 which makes turning ipv6 on a highly manual process.
For example:
Terraform Version
0.9.2
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Terraform should be able to evaluate the ternary and see that use_ipv6 is 0 and then not evaluate aws_vpc.vpc.ipv6_cidr_block.
Actual Behavior
Terraform evaluates both branches of the ternary and returns the error pasted above.
Steps to Reproduce
terraform plan
References
#13588
The text was updated successfully, but these errors were encountered: