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

replace VPC data with variable #23

Open
dudicoco opened this issue Sep 14, 2022 · 0 comments
Open

replace VPC data with variable #23

dudicoco opened this issue Sep 14, 2022 · 0 comments

Comments

@dudicoco
Copy link

Hi,

Currently, the VPC CIDR block is pulled from the VPC data:

data "aws_vpc" "this" {
id = var.endpoint_vpc_id
}

This is problematic when using terragrunt run-all to set up an entire stack (vpc + client vpn etc.) as the plan will fail since the VPC doesn't exist yet:

│ Error: no matching EC2 VPC found
│
│   with module.vpn.data.aws_vpc.this,
│   on .terraform/modules/vpn/main.tf line 42, in data "aws_vpc" "this":
│   42: data "aws_vpc" "this" {
│

I assume this would also happen when running normal terraform plan (without terragrunt) with vpc + client vpn in the same main.tf, but I didn't test it.

The solution is to remove the VPC data resource and add a new variable endpoint_vpc_cidr_block.
Will be happy to contribute a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant