terraform-aws-modules / terraform-aws-vpn-gateway

Terraform module to create AWS VPN gateway resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/vpn-gateway/aws
Apache License 2.0
111 stars 156 forks source link

Error when using example <complete-vpn-connection-transit-gateway> #31

Closed eici closed 2 years ago

eici commented 4 years ago

Terraform v0.12.20 provider.aws v2.47.0

if i do:

i get the error message down below.


terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

Error: Invalid template interpolation value

  on ../../main.tf line 13, in locals:
  13:   connection_identifier = var.connect_to_transit_gateway ? "TGW ${var.transit_gateway_id}" : "VPC ${var.vpc_id}"
    |----------------
    | var.vpc_id is null

The expression result is null. Cannot include a null value in a string
template.```
dinodam commented 4 years ago

I have the same issue as mentioned above.

Terraform v0.12.24

I just copied your example to a local file and call the module remotely

`#create VPN gatway

module "vpn_gateway_1" { source = "terraform-aws-modules/vpn-gateway/aws" version = "~> 2.0"

transit_gateway_id = aws_ec2_transit_gateway.this.id customer_gateway_id = module.vpc.cgw_ids[0]

tunnel1_inside_cidr = "169.254.44.88/30" tunnel2_inside_cidr = "169.254.44.100/30" tunnel1_preshared_key = "1234567890abcdefghijklmn" tunnel2_preshared_key = "abcdefghijklmn1234567890" }

module "vpn_gateway_2" { source = "terraform-aws-modules/vpn-gateway/aws" version = "~> 2.0"

transit_gateway_id = aws_ec2_transit_gateway.this.id customer_gateway_id = module.vpc.cgw_ids[1]

tunnel1_inside_cidr = "169.254.33.88/30" tunnel2_inside_cidr = "169.254.33.100/30" tunnel1_preshared_key = "1234567890abcdefghijklmn" tunnel2_preshared_key = "abcdefghijklmn1234567890" }

resource "aws_ec2_transit_gateway" "this" { description = "complete-vpn-connection-transit-gateway" }

resource "aws_ec2_transit_gateway_vpc_attachment" "this" { subnet_ids = module.vpc.private_subnets transit_gateway_id = aws_ec2_transit_gateway.this.id vpc_id = module.vpc.vpc_id }`

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] commented 2 years ago

This issue was automatically closed because of stale in 10 days

github-actions[bot] commented 2 years ago

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.