Created
February 19, 2022 06:18
-
-
Save dev-daeun/7ebc01c5c800e966b7bd09a22298d2f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_iam_user" "ecr-user" { | |
name = "ecr-user" | |
path = "/system/" | |
tags = { | |
Environment = "${var.environment}" | |
Service = "${var.service}" | |
} | |
} | |
resource "aws_iam_user_policy" "ecr-user-policy" { | |
name = "ecr-user-policy" | |
user = aws_iam_user.ecr-user.name | |
# AWS profile 계정에 생성되어 있는 모든 ECR 리소스에 ecr 관련 모든 액션을 수행할 권한이 있음. | |
policy = jsonencode({ | |
Version = "2012-10-17" | |
Statement = [ | |
{ | |
Action = [ | |
"ecr:*", | |
] | |
Effect = "Allow" | |
Resource = "*" | |
}, | |
] | |
}) | |
} | |
resource "aws_iam_access_key" "ecr-user-access-key" { | |
user = aws_iam_user.ecr-user.name | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment