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

Terraform plan does not validate aws.vpc.cidr_block #6567

Closed
ghost opened this issue Nov 23, 2018 · 3 comments · Fixed by #6577
Closed

Terraform plan does not validate aws.vpc.cidr_block #6567

ghost opened this issue Nov 23, 2018 · 3 comments · Fixed by #6577
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@ghost
Copy link

ghost commented Nov 23, 2018

This issue was originally opened by @gfysaris as hashicorp/terraform#19452. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.11.10
+ provider.aws v1.46.0

Terraform Configuration Files

resource "aws_vpc" "XXX" {
  cidr_block           = "10.0.0.0/8"
  enable_dns_support   = true
  enable_dns_hostnames = true

  tags {
    Name = "XXX"
  }
}

Debug Output

Crash Output

Expected Behavior

Error: Error generating plan
1 error(s) occurred:
* aws_vpc.XXX: 1 error(s) occurred:
* aws_vpc.XXX: Error creating VPC: InvalidVpc.Range: The CIDR '10.0.0.0/8' is invalid.
	status code: 400, request id: 0123456789

Actual Behavior

  + aws_vpc.XXX
      id:                                          <computed>
      arn:                                         <computed>
      assign_generated_ipv6_cidr_block:            "false"
      cidr_block:                                  "10.0.0.0/8"
      default_network_acl_id:                      <computed>
      default_route_table_id:                      <computed>
      default_security_group_id:                   <computed>
      dhcp_options_id:                             <computed>
      enable_classiclink:                          <computed>
      enable_classiclink_dns_support:              <computed>
      enable_dns_hostnames:                        "true"
      enable_dns_support:                          "true"
      instance_tenancy:                            "default"
      ipv6_association_id:                         <computed>
      ipv6_cidr_block:                             <computed>
      main_route_table_id:                         <computed>
      tags.%:                                      "1"
      tags.Name:                                   "XXX"


Plan: 1 to add, 0 to change, 0 to destroy.

Steps to Reproduce

terraform init
terraform apply

Additional Context

 Block sizes must be between a /16 netmask and /28 netmask.

References

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. labels Nov 25, 2018
@bflad bflad added this to the v1.47.0 milestone Nov 26, 2018
@bflad
Copy link
Contributor

bflad commented Nov 26, 2018

Plan-time validation for the size of the block has been merged and will release with version 1.47.0 of the AWS provider, sometime later this week. 👍

@bflad
Copy link
Contributor

bflad commented Nov 30, 2018

This was released (4 days ago) in version 1.47.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link
Author

ghost commented Apr 2, 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 Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant