1. 프라이빗 레포

  2. 레포에 권한 설정

    {
      "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"
          ]
        }
      ]
    }
    

    EB IAM에 ECR 권한 정책 부여

    ECR 정책 만들기

    ARN: arn:aws:ecr::375839059348:repository/

    Untitled

    {
        "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에 부여

    위에서 만든 정책을 기존 EB용 IAM에 적용

    Untitled