Skip to content

Commit

Permalink
[DOM-62207] VPC Endpint for ECR (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
msingermann-domino authored Nov 13, 2024
1 parent a8c6915 commit da61236
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/infra/submodules/network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ No modules.
| [aws_subnet.private](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet) | resource |
| [aws_subnet.public](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet) | resource |
| [aws_vpc.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc) | resource |
| [aws_vpc_endpoint.ecr_dkr](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) | resource |
| [aws_vpc_endpoint.s3](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_endpoint) | resource |
| [aws_vpc_ipv4_cidr_block_association.pod_cidr](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_ipv4_cidr_block_association) | resource |
| [aws_availability_zone.zones](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/availability_zone) | data source |
Expand Down
13 changes: 13 additions & 0 deletions modules/infra/submodules/network/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@ data "aws_prefix_list" "s3" {
prefix_list_id = aws_vpc_endpoint.s3[0].prefix_list_id
}

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

tags = {
"Name" = "${var.deploy_id}-ecr-dkr"
}
}

data "aws_network_acls" "default" {
count = local.create_vpc ? 1 : 0
vpc_id = aws_vpc.this[0].id
Expand Down

0 comments on commit da61236

Please sign in to comment.