erc 모듈화, vpc public dns 설정 등

This commit is contained in:
2022-12-26 14:34:38 +09:00
parent a0d22896a0
commit 535d721a50
14 changed files with 123 additions and 115 deletions

35
modules/ecr/main.tf Normal file
View File

@ -0,0 +1,35 @@
//ecr make
resource "aws_ecr_repository" "ecr" {
for_each = toset(var.names_list)
name = each.value
image_tag_mutability = "MUTABLE"
image_scanning_configuration {
scan_on_push = true
}
}
# resource "aws_ecr_repository" "bar" {
# name = "demo-frontend"
# image_tag_mutability = "MUTABLE"
# image_scanning_configuration {
# scan_on_push = true
# }
# }
# resource "null_resource" "null_for_ecr_get_login_password" {
# provisioner "local-exec" {
# command = <<EOF
# aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin ${aws_ecr_repository.foo.repository_url}
# EOF
# }
# }
# output "ecr_registry_id" {
# value = aws_ecr_repository.foo.registry_id
# }
# output "ecr_repository_url" {
# value = aws_ecr_repository.foo.repository_url
# }
# --region ${AWS_REGION}

9
modules/ecr/valiables.tf Normal file
View File

@ -0,0 +1,9 @@
variable "names_list" {
description = "name list"
type = list(string)
}
# default = [
# "web",
# "nginx",
# "mariadb",
# ]