hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.81k stars 9.15k forks source link

resource/aws_subnet: Add plan-time validation #34465

Open gdavison opened 11 months ago

gdavison commented 11 months ago

Description

An aws_subnet requires at least one of cidr_block, ipv6_cidr_block, ipv4_ipam_pool_id, or ipv6_ipam_pool_id. There is currently no plan-time validation for this, but there should be.

Affected Resource(s) and/or Data Source(s)

aws_subnet

Potential Terraform Configuration

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 11 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

delta1513 commented 6 months ago

Is this something that needs to be done on a per-resource basis or is this something that can be done generally?

I ask this because recently made a typo in one of my AWS resources and didn't catch this until apply-time and I was genuinely surprised that there's nothing that caught my error until then. terraform validate and tflint couldn't catch it either.