Open kaitokimuraofficial opened 1 month ago
プライベートサブネットからECRのイメージを使うためには以下の二つのVCPエンドポイントを設定する必要がある
resource "aws_vpc_endpoint" "ecr_api" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.ap-northeast-1.ecr.api"
vpc_endpoint_type = "Interface"
private_dns_enabled = true
policy = data.aws_iam_policy_document.ssm_vpc_endpoint.json
subnet_ids = [
aws_subnet.subnets["private-1c"].id
]
security_group_ids = [
aws_security_group.ssm_vpc_endpoint.id
]
tags = {
Name = "ecr-api-private-1c-${local.name_suffix}"
}
}
resource "aws_vpc_endpoint" "ecr_dkr" {
vpc_id = aws_vpc.main.id
service_name = "com.amazonaws.ap-northeast-1.ecr.dkr"
vpc_endpoint_type = "Interface"
private_dns_enabled = true
policy = data.aws_iam_policy_document.ssm_vpc_endpoint.json
subnet_ids = [
aws_subnet.subnets["private-1c"].id
]
security_group_ids = [
aws_security_group.ssm_vpc_endpoint.id
]
tags = {
Name = "ecr-dkr-private-1c-${local.name_suffix}"
}
}
What
Describe the solution you'd like
Why
Describe related problems
Others
Describe what you want to describe
Refs