diff --git a/live/core/vpc.tf b/live/core/vpc.tf index 57a57b3..ae45af9 100644 --- a/live/core/vpc.tf +++ b/live/core/vpc.tf @@ -11,7 +11,6 @@ module "vpc" { tags = module.label.tags enable_nat_gateway = true single_nat_gateway = true - region = var.region } output "ssm_parameter_vpc_id" { diff --git a/modules/vpc/endpoints.tf b/modules/vpc/endpoints.tf index 144821f..b48d980 100644 --- a/modules/vpc/endpoints.tf +++ b/modules/vpc/endpoints.tf @@ -1,7 +1,9 @@ +data "aws_region" "current" {} + resource "aws_vpc_endpoint" "secrets_manager" { vpc_id = module.vpc.vpc_id - service_name = "com.amazonaws.${var.region}.secretsmanager" + service_name = "com.amazonaws.${data.aws_region.current.name}.secretsmanager" security_group_ids = [module.app_security_group.security_group_id] # You can specify security groups if needed subnet_ids = module.vpc.private_subnets # Associate with private subnets diff --git a/modules/vpc/variables.tf b/modules/vpc/variables.tf index 05bb2dc..13496b0 100644 --- a/modules/vpc/variables.tf +++ b/modules/vpc/variables.tf @@ -33,9 +33,3 @@ variable "tags" { type = map(any) default = {} } - -variable "region" { - description = "AWS region" - type = string - default = "us-west-2" -}