Hi I have created inspection (with engress) VPC and ingress VPC but when I used only the vpc id in the mudle, it does not work. Could you show an example with the use of VPC ids for inspection ingress and spoke vpc?
Voici le code:
module "hub-and-spoke" {
source = "../modules/terraform-aws-network-hubandspoke"
For testing purposes, uncomment the line below and comment the "source" and "version" lines above
source = "../.."
identifier = "test"
transit_gateway_id = aws_ec2_transit_gateway.tgw.id
network_definition = {
type = "CIDR"
value = "10.0.0.0/8"
}
central_vpcs = {
Voici le message d'erreur quand je fais le terraform plan
Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: Unsupported attribute
│
│ on ..\modules\terraform-aws-network-hubandspoke\main.tf line 40, in module "central_vpcs":
│ 40: az_count = each.value.az_count
│ ├────────────────
│ │ each.value is object with 1 attribute "vpc_id"
│
│ This object does not have an attribute named "az_count".
╵
╷
│ Error: Unsupported attribute
│
│ on ..\modules\terraform-aws-network-hubandspoke\main.tf line 40, in module "central_vpcs":
│ 40: az_count = each.value.az_count
│ ├────────────────
│ │ each.value is object with 1 attribute "vpc_id"
│
│ This object does not have an attribute named "az_count".
╵
╷
│ Error: Invalid value for variable
│
│ on ..\modules\terraform-aws-network-hubandspoke\main.tf line 49, in module "central_vpcs":
│ 49: subnets = merge(try(each.value.subnets, {}), local.subnet_config[each.key])
│ ├────────────────
│ │ var.subnets is object with 2 attributes
│
│ Each subnet type must contain only 1 key: cidrs or netmask or ipv6_native.
│
│ This was checked by the validation rule at ..\modules\terraform-aws-vpc\variables.tf:277,3-13.
╵
╷
│ Error: Invalid value for variable
│
│ on ..\modules\terraform-aws-network-hubandspoke\main.tf line 49, in module "central_vpcs":
│ 49: subnets = merge(try(each.value.subnets, {}), local.subnet_config[each.key])
│ ├────────────────
│ │ var.subnets is object with 2 attributes
│
│ Each subnet type must contain only 1 key: cidrs or netmask or ipv6_native.
│
│ This was checked by the validation rule at ..\modules\terraform-aws-vpc\variables.tf:277,3-13.
╵
Hi I have created inspection (with engress) VPC and ingress VPC but when I used only the vpc id in the mudle, it does not work. Could you show an example with the use of VPC ids for inspection ingress and spoke vpc?
Voici le code: module "hub-and-spoke" { source = "../modules/terraform-aws-network-hubandspoke"
For testing purposes, uncomment the line below and comment the "source" and "version" lines above
source = "../.."
identifier = "test" transit_gateway_id = aws_ec2_transit_gateway.tgw.id network_definition = { type = "CIDR" value = "10.0.0.0/8" } central_vpcs = {
}
ingress = { vpc_id = module.ingress_vpc.vpc_attributes.id
} }
Voici le message d'erreur quand je fais le terraform plan
Planning failed. Terraform encountered an error while generating this plan.
╷ │ Error: Unsupported attribute │ │ on ..\modules\terraform-aws-network-hubandspoke\main.tf line 40, in module "central_vpcs": │ 40: az_count = each.value.az_count │ ├──────────────── │ │ each.value is object with 1 attribute "vpc_id" │ │ This object does not have an attribute named "az_count". ╵ ╷ │ Error: Unsupported attribute │ │ on ..\modules\terraform-aws-network-hubandspoke\main.tf line 40, in module "central_vpcs": │ 40: az_count = each.value.az_count │ ├──────────────── │ │ each.value is object with 1 attribute "vpc_id" │ │ This object does not have an attribute named "az_count". ╵ ╷ │ Error: Invalid value for variable │ │ on ..\modules\terraform-aws-network-hubandspoke\main.tf line 49, in module "central_vpcs": │ 49: subnets = merge(try(each.value.subnets, {}), local.subnet_config[each.key]) │ ├──────────────── │ │ var.subnets is object with 2 attributes │ │ Each subnet type must contain only 1 key:
cidrs
ornetmask
oripv6_native
. │ │ This was checked by the validation rule at ..\modules\terraform-aws-vpc\variables.tf:277,3-13. ╵ ╷ │ Error: Invalid value for variable │ │ on ..\modules\terraform-aws-network-hubandspoke\main.tf line 49, in module "central_vpcs": │ 49: subnets = merge(try(each.value.subnets, {}), local.subnet_config[each.key]) │ ├──────────────── │ │ var.subnets is object with 2 attributes │ │ Each subnet type must contain only 1 key:cidrs
ornetmask
oripv6_native
. │ │ This was checked by the validation rule at ..\modules\terraform-aws-vpc\variables.tf:277,3-13. ╵