프라이빗 레포
레포에 권한 설정
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "GetAuthorizationToken",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::375839059348:user/sulsul-eb"
},
"Action": "ecr:GetAuthorizationToken"
},
{
"Sid": "AllowPushAndPull",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::375839059348:user/sulsul-eb"
},
"Action": [
"ecr:BatchCheckLayerAvailability",
"ecr:BatchGetImage",
"ecr:CompleteLayerUpload",
"ecr:GetDownloadUrlForLayer",
"ecr:InitiateLayerUpload",
"ecr:PutImage",
"ecr:UploadLayerPart"
]
}
]
}
sulsul-eb
IAM에 ecr push, pull할 권한 부여ecr:GetAuthorizationToken
: github action을 사용하기 필요한 토큰을 사용할 수 있는 권한 부여AllowPushAndPull
: ECR 레포에 이미지 푸시, 풀 권한ARN: arn:aws:ecr::375839059348:repository/
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ecr:GetRegistryPolicy",
"ecr:CreateRepository",
"ecr:DescribeRegistry",
"ecr:DescribePullThroughCacheRules",
"ecr:GetAuthorizationToken",
"ecr:PutRegistryScanningConfiguration",
"ecr:CreatePullThroughCacheRule",
"ecr:DeletePullThroughCacheRule",
"ecr:PutRegistryPolicy",
"ecr:GetRegistryScanningConfiguration",
"ecr:BatchImportUpstreamImage",
"ecr:DeleteRegistryPolicy",
"ecr:PutReplicationConfiguration"
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": "ecr:*",
"Resource": "arn:aws:ecr:ap-northeast-2:375839059348:repository/*"
}
]
}
위에서 만든 정책을 기존 EB용 IAM에 적용