Skill 1.4.1

Configuring security permissions to allow access to artifact repositories (for example, IAM, CodeArtifact)

Key Concepts

EC2 instances deployed by CodeDeploy need an instance profile that can read the revision from S3 (and decrypt it with KMS). ECS tasks need a task execution role with ECR pull permissions (ecr:GetAuthorizationToken, ecr:BatchGetImage, ecr:GetDownloadUrlForLayer). Cross-account pulls also need an ECR repository policy allowing the other account.

CodeArtifact access needs both codeartifact:GetAuthorizationToken and sts:GetServiceBearerToken in IAM, plus read permissions on the repository, and the domain or repository resource policy must allow other accounts. Use least-privilege policies scoped to specific repositories.