-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Cannot conditionally define subnet ipv6 cidr blocks when conditionally defining ipv6 cidr block for vpc #688
Comments
Looks related to hashicorp/hil#50? I couldn't get the suggested |
@stack72 I think you've done a bunch of the work on the AWS IPv6 support, I'm actually curious why the code here doesn't handle this situation? (ie setting Is it possible that the code should check |
@phillbaker I ran into the same issue and decided to play round with the provider code a bit. Moving the What do you think? Is it worth doing a PR for this anyway? In the end, the problem remains the conditional operator. There is an issue that's supposed to address this in hashicorp/hil#50 but that doesn't look like a simple fix... |
Hey, sorry for the slow reply @flosell, thanks for digging into this! I'd say seems worthwhile to do the PR since it seems like there's some movement to fix hashicorp/hil#50 in hashicorp/terraform#11566 (comment) |
hashicorp#2103 * resource/aws_vpc: Set ipv6 properties even if no ipv6 is enabled to allow usage in conditionals (fixes hashicorp#688) hashicorp#2103
…in conditionals (fixes hashicorp#688)
…in conditionals (fixes hashicorp#688)
The fix for this has been merged and will release with version 1.43.1 of the AWS provider. |
There's still the same issue for the |
…age in conditionals (fixes terraform-providers#688 but for subnet instead of VPC)
The similar fix for |
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! |
This issue was originally opened by @philipl as hashicorp/terraform#13590. It was migrated here as part of the provider split. The original body of the issue is below.
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 hashicorp/terraform#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: