- Source (a Git repository such as
CodeCommit, GitHub, GitLab, Bitbucket, etc.) - Build and test (for example
CodeBuild) - Artifact storage (S3, CodeArtifact, or an external artifact repository)
- Deployment (e.g.,
CodeDeploy, CloudFormation, Terraform, or direct SDK/API calls)
You will often see
CodeCommit shown in diagrams as a generic “source” provider. It is a fully supported AWS Git service and is commonly used as a placeholder for whatever Git host your organization uses. Substitute your Git provider as needed.Single-account pipelines
In a single-account pipeline, development, staging, and production stages exist in the same AWS account. This pattern is common for small teams, labs, startups, or internal tooling where simplicity and speed of iteration are priorities. Advantages- Simpler to set up: fewer cross-account IAM roles and policies to configure.
- Lower operational overhead for centralized logging and monitoring.
- Faster debugging because resources and IAM are managed in one account.
- Cost-efficient when duplicating infrastructure across accounts is undesirable.

- Service quotas and limits are typically per-account (and often per-region). Consolidating everything in one account concentrates quota usage.
- Centralized logging (CloudTrail, CloudWatch Logs, AWS Config) is straightforward because logs originate from the same account.
- Environment isolation is enforced via IAM policies, VPC segmentation, and tagging—not by account boundaries—so the security boundary is weaker than a multi-account model.
- Harder to achieve strict compliance and isolation requirements.
- Scaling across many teams is more complex because resource access and permissions must be partitioned in a single account.
- Governance and audit separation can be less clear than account-level separation.


Multi-account pipelines
A multi-account pipeline splits responsibilities across multiple AWS accounts—commonly a tooling/shared-services account (for CI/CD tooling, artifact stores, and secrets), separate dev and test accounts, and a production account. These are typically managed under an AWS Organization so you can apply centralized governance, Service Control Policies (SCPs), and consolidated billing. Benefits- Stronger isolation between environments (dev/test/prod).
- Reduced blast radius and clearer security boundaries.
- Easier enforcement of governance and compliance via account-level controls and SCPs.
- Better scalability for large organizations where teams own accounts or workloads.

- Source: repository may be hosted in the tooling account or an external Git provider.
- Build & test: commonly executed in the tooling account (for example,
CodeBuild), with artifacts stored in a centralized artifact store (S3, CodeArtifact, or an external repo). - Deploy:
CodePipelinein the tooling account assumes cross-account deployment roles in target accounts (dev/test/prod) to deploy artifacts. Those roles must be scoped narrowly (specific S3 objects, functions, or CloudFormation stacks) and follow least-privilege principles. - Manual approvals: typical as gates before production deployments. Continuous delivery uses manual gating; continuous deployment performs automatic promotions (organizations choose based on risk tolerance).
- Centralized logging and auditing: use a logging account or aggregators (CloudTrail aggregation, AWS Config aggregators) to collect telemetry across accounts.
- Tooling account builds and stores Lambda artifacts (packaged code, layers).
- The deployment pipeline assumes a cross-account role in the target account and provisions Lambda versions or updates configuration there.

- Increased operational complexity due to cross-account IAM roles, trust policies, and permission boundaries.
- Additional work to centralize observability and security (CloudTrail aggregation, cross-account S3 bucket policies, and KMS key usage across accounts).
- Potentially higher costs for monitoring, guardrails, and duplicated services—although shared tooling accounts can mitigate duplication.
- Possible deployment latency across regions or accounts with differing regional setups.

Cross-account pipeline example (summary)
- A commit or merge to
mainfires an EventBridge event or repository webhook. CodePipelinein the tooling account kicks off a build & test stage (for example,CodeBuild).- Artifacts are stored centrally (S3, CodeArtifact, or an external artifact repo).
- After tests pass,
CodePipelineassumes a deployment role in the development account to perform the deploy. - After validation, a manual approval gate may be required before the pipeline assumes the production deployment role and runs
CodeDeploy, CloudFormation, or another deployment mechanism to update production.
Quick comparison
Notes and recommendations
- Use a dedicated tooling/shared-services account for CI/CD tooling and centralized artifact storage when possible.
- Keep cross-account permissions minimal — grant only the necessary role policies for deployments and scope to specific resources.
- Centralize logging and auditing to an aggregated account to simplify compliance and incident analysis.
- Choose continuous delivery (manual gate) or continuous deployment (automatic promotion) based on organizational risk tolerance and culture.
- Consider service quotas and regional configurations when consolidating resources or planning multi-account deployments.
Cross-account deployments increase the complexity of IAM trust policies, KMS key access, and S3 bucket policies. Always follow least-privilege principles, test role assumptions in a staging environment, and document trust relationships to avoid accidental privilege escalation.
- AWS CodePipeline documentation
- AWS Organizations and Service Control Policies
- AWS IAM Roles and AWS STS
- Centralized logging strategies with CloudTrail and CloudWatch