Update CodeBuild Role

Update CodeBuild Role

  1. Access the IAM service:
  • On the left menu, choose Roles.
  • Search for codebuild.
  • Select the codebuild role corresponding to your project.

FCJ_ws2

  1. Choose Add permissions, then Create inline policy.

FCJ_ws2

  1. Copy and paste the policy below into the Policy editor. Then scroll down and choose Next.
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ecr-public:GetAuthorizationToken",
        "sts:GetServiceBearerToken",
        "ecr-public:BatchCheckLayerAvailability",
        "ecr-public:GetRepositoryPolicy",
        "ecr-public:DescribeRepositories",
        "ecr-public:DescribeRegistries",
        "ecr-public:DescribeImages",
        "ecr-public:DescribeImageTags",
        "ecr-public:GetRepositoryCatalogData",
        "ecr-public:GetRegistryCatalogData"
      ],
      "Resource": "*"
    }
  ]
}

FCJ_ws2

  1. In the Policy name field, enter FCJ_ECR_Public_Access. Then press Create policy.

FCJ_ws2

  1. Confirm that the policy has been added successfully.

FCJ_ws2

  1. Continue to choose Add permissions, then Attach policies.

FCJ_ws2

  1. Search for AmazonEC2ContainerRegistryFullAccess. Select and press Add permissions.

FCJ_ws2

  1. Confirm that the policy has been added successfully.

FCJ_ws2