using the below code in-order to create AWS VPC and dependencies. The variable values are set by terragrunt which executing the TF code.
After many re-executions of project includes this code, following bellow appear
Code
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
name = var.vpc_name
cidr = var.vpc_cidr
azs = var.azs
private_subnets = var.private_subnets
public_subnets = var.public_subnets
enable_nat_gateway = var.enable_nat_gateway
single_nat_gateway = var.single_nat_gateway
nat_gateway_tags = var.nat_gateway_tags
private_subnet_names = var.private_subnet_names
public_subnet_names = var.public_subnet_names
public_subnet_tags = var.public_subnet_tags
private_subnet_tags = var.private_subnet_tags
igw_tags = var.igw_tags
map_public_ip_on_launch = true
enable_vpn_gateway = false
manage_default_security_group = false
manage_default_route_table = false
manage_default_network_acl = false
private_route_table_tags = var.private_route_table_tags
public_route_table_tags = var.public_route_table_tags
tags = var.tags
}
Errors
│ The variable nat_gateway_tags cannot be set using the -var and -var-file
│ options when applying a saved plan file, because a saved plan includes the
│ variable values that were set when it was created. The saved plan specifies
│ "{\"Name\":\"zengo-vpc-qa-nat-gateway\"}" as the value whereas during apply
│ the value object with 1 attribute "Name" was set by an environment
│ variable. To declare an ephemeral variable which is not saved in the plan
│ file, use ephemeral = true.
╵
╷
│ Error: Can't change variable when applying a saved plan
│
│ The variable private_route_table_tags cannot be set using the -var and
│ -var-file options when applying a saved plan file, because a saved plan
│ includes the variable values that were set when it was created. The saved
│ plan specifies "{\"Name\":\"zengo-vpc-qa-private_route_table\"}" as the
│ value whereas during apply the value object with 1 attribute "Name" was set
│ by an environment variable. To declare an ephemeral variable which is not
│ saved in the plan file, use ephemeral = true.
What am I missing here ?
Thx