Black Friday sale: an extra 40% off every course until Monday, November 30.New Year sale: an extra 30% off every course until Friday, January 1.Memorial Day sale: an extra 25% off every course until Monday, May 31.SysAdmin Day sale: an extra 25% off every course until Sunday, August 1.Back to School sale: an extra 25% off every course until Sunday, August 22.Labor Day sale: an extra 25% off every course until Monday, September 6.Black Friday sale: an extra 40% off every course until Monday, November 29.New Year sale: an extra 30% off every course until Saturday, January 1.Choose your certification →

Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.1.4.5. Configuring Security Permissions for Artifact Access (IAM, CodeArtifact)

2.1.4.5. Configuring Security Permissions for Artifact Access (IAM, Cross-Account)

Deployment pipelines cross account and service boundaries — and each boundary needs explicit IAM permissions. A missing permission anywhere in the chain silently breaks the pipeline.

CodeDeploy service role needs permissions to read deployment bundles from S3, manage EC2 instances, update ECS services, or invoke Lambda functions (depending on the compute platform). AWS provides managed policies: AWSCodeDeployRole for EC2/on-premises, AWSCodeDeployRoleForECS for ECS.

EC2 instance profile for CodeDeploy targets needs s3:GetObject on the artifact bucket and s3:GetBucketLocation. Without the instance profile, the CodeDeploy agent can't download the deployment bundle.

Cross-account deployments require:

  1. The artifact bucket in Account A grants s3:GetObject to Account B's CodeDeploy role
  2. The KMS key encrypting artifacts grants kms:Decrypt to Account B's role
  3. A deployment role in Account B whose trust policy allows Account A's pipeline role to assume it, and sts:AssumeRole on that role's ARN in the pipeline role's policy in Account A — both halves are required. Access Denied while assuming the role points at the trust policy; Access Denied reading artifacts points at the bucket or KMS key policy
{
  "Effect": "Allow",
  "Principal": {"AWS": "arn:aws:iam::ACCOUNT_B:role/CodeDeployRole"},
  "Action": ["s3:GetObject", "s3:GetObjectVersion"],
  "Resource": "arn:aws:s3:::pipeline-artifacts/*"
}

ECR cross-account image pulls require a repository policy granting ecr:GetDownloadUrlForLayer, ecr:BatchGetImage, and ecr:BatchCheckLayerAvailability to the consuming account.

Exam Trap: Cross-account pipelines in CodePipeline use a customer-managed KMS key (not the default aws/s3 key). The default key can't be shared cross-account. If you see "Access Denied" errors in cross-account pipeline stages, the KMS key policy is the first place to check.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•26 professional certifications earned