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

CIDR variable cant be defaulted to an empty string #86

Closed
egarbi opened this issue Feb 22, 2018 · 6 comments · Fixed by #93
Closed

CIDR variable cant be defaulted to an empty string #86

egarbi opened this issue Feb 22, 2018 · 6 comments · Fixed by #93

Comments

@egarbi
Copy link

egarbi commented Feb 22, 2018

Terraform Version

Terraform v0.11.2

Terraform Configuration Files

# AWS credentials and region
provider "aws" {
  region = "${var.region}"
}

module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "1.9.1"
}

Expected Behavior

Plan should finish without errors

Actual Behavior

Error: module.vpc.aws_vpc.this: "cidr_block" must contain a valid CIDR, got error parsing: invalid CIDR address:

Steps to Reproduce

  1. terraform init
  2. terraform plan
@egarbi egarbi changed the title CIDR block cant be defaulted to an empty string CIDR variable cant be defaulted to an empty string Feb 22, 2018
@antonbabenko
Copy link
Member

If you don't want to create VPC you should write like this:

module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "1.9.1"

  create_vpc = false
}

if you want to create VPC you should specify CIDR like this:

module "vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = "1.9.1"

  cidr = "10.0.0.0/20"
}

@egarbi
Copy link
Author

egarbi commented Feb 23, 2018

@antonbabenko I know how this module work, I was trying to pointing out a particular issue if I use the module without required values as indicated in registry's doc.
Maybe then default the create_vpc value to false. Don't know...

@antonbabenko
Copy link
Member

@egarbi I could not leave this one as is, so please take a look at #93 :)

@egarbi
Copy link
Author

egarbi commented Mar 6, 2018

Hi @antonbabenko sorry for the delay, this is better, the apply will exit with an error message and the user will be able to notice what is needed to change.

@antonbabenko
Copy link
Member

v1.26.0 has been released. Thanks for your help!

@github-actions
Copy link

github-actions bot commented Nov 5, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants