Skip to content

Commit

Permalink
Add private endpoint for s3
Browse files Browse the repository at this point in the history
  • Loading branch information
msingermann-domino committed Feb 12, 2025
1 parent fd32560 commit 9e9183a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/infra/submodules/network/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ resource "aws_vpc_endpoint" "s3" {
}
}

resource "aws_vpc_endpoint" "s3_interface" {
count = local.create_vpc ? 1 : 0
vpc_id = aws_vpc.this[0].id
service_name = "com.amazonaws.${var.region}.s3"
vpc_endpoint_type = "Interface"
private_dns_enabled = true
subnet_ids = [for s in aws_subnet.pod : s.id]

route_table_ids = concat(local.public_route_table_ids, local.private_route_table_ids, local.pod_route_table_ids)

tags = {
"Name" = "${var.deploy_id}-s3"
}
}

data "aws_prefix_list" "s3" {
count = local.create_vpc ? 1 : 0
prefix_list_id = aws_vpc_endpoint.s3[0].prefix_list_id
Expand Down

0 comments on commit 9e9183a

Please sign in to comment.