File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,13 @@ module "vpc_endpoints" {
122122 service = " ecs"
123123 private_dns_enabled = true
124124 subnet_ids = module.vpc.private_subnets
125+ subnet_configurations = [
126+ for v in module . vpc . private_subnet_objects :
127+ {
128+ ipv4 = cidrhost (v. cidr_block , 10 )
129+ subnet_id = v.id
130+ }
131+ ]
125132 },
126133 ecs_telemetry = {
127134 create = false
Original file line number Diff line number Diff line change @@ -26,9 +26,19 @@ module "endpoints" {
2626 tags = { Name = "dynamodb-vpc-endpoint" }
2727 },
2828 sns = {
29- service = "sns"
30- subnet_ids = ["subnet-12345678", "subnet-87654321"]
31- tags = { Name = "sns-vpc-endpoint" }
29+ service = "sns"
30+ subnet_ids = ["subnet-12345678", "subnet-87654321"]
31+ subnet_configurations = [
32+ {
33+ ipv4 = "10.8.34.10"
34+ subnet_id = "subnet-12345678"
35+ },
36+ {
37+ ipv4 = "10.8.35.10"
38+ subnet_id = "subnet-87654321"
39+ }
40+ ]
41+ tags = { Name = "sns-vpc-endpoint" }
3242 },
3343 sqs = {
3444 service = "sqs"
Original file line number Diff line number Diff line change @@ -46,6 +46,16 @@ resource "aws_vpc_endpoint" "this" {
4646 }
4747 }
4848
49+ dynamic "subnet_configuration" {
50+ for_each = try (each. value . subnet_configurations , [])
51+
52+ content {
53+ ipv4 = try (subnet_configuration. value . ipv4 , null )
54+ ipv6 = try (subnet_configuration. value . ipv6 , null )
55+ subnet_id = try (subnet_configuration. value . subnet_id , null )
56+ }
57+ }
58+
4959 tags = merge (
5060 var. tags ,
5161 { " Name" = replace (each. key , " ." , " -" ) },
You can’t perform that action at this time.
0 commit comments