Skip to main content
Welcome. This lesson compares single-account and multi-account CI/CD pipelines in AWS, describes common reference architectures, and highlights trade-offs so you can choose the right approach for your organization. At a high level, AWS CodePipeline is the orchestration layer for CI/CD. A typical pipeline includes:
  • 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.
CodePipeline is typically triggered by source changes (webhooks) or EventBridge events. It runs builds and tests, produces artifacts, and orchestrates deployments into target environments.

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.
Typical use cases: product teams running Product A in AWS account 1, Product B in account 2, and separate accounts for shared services or corporate workloads. You generally avoid splitting a single product across many accounts unless organizational requirements demand it.
A slide diagram titled "Single-Account Pipelines in AWS" showing four items — Product A, Product B, Shared services, and Internal corporate stuff — each pointing to its own AWS account icon labeled AWS account 1–4. A caption below notes you typically won't have multiple AWS accounts for a single product.
Practical considerations for single-account setups
  • 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.
Common drawbacks
  • 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.
A presentation slide titled "Single-Account Pipelines in AWS – Advantages" showing five numbered cards with colorful icons listing benefits: simplicity and ease of setup, lower cost, faster development and deployment, easier debugging and monitoring, and seamless resource access. The layout uses round gradient icons above brief captions.
A slide titled "Single-Account Pipelines in AWS – Limitations" showing four colored panels. It lists: 01 Security risks and compliance issues; 02 Lack of environment isolation; 03 Difficult to scale for large teams; 04 Difficult to enforce governance and compliance policies.

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.
Architectural note: CI/CD tooling usually runs in a dedicated tooling account. Pipelines in that account assume cross-account IAM roles in target accounts (via AWS STS) to perform deployments. Central identity (SSO or corporate IdP) can manage users, while role assumption provides least-privilege access into each account.
A presentation slide titled "Multi-Account Pipelines in AWS – Advantages" displaying four numbered cards listing benefits: Improved security, Clear separation of environments, Better governance and compliance, and Scalability and flexibility. Each card has a colored circular icon (orange, pink, green, purple) above its label.
Multi-account pipeline flow and considerations
  • 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: CodePipeline in 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.
Example — serverless deployments:
  • 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.
A diagram titled "Multi-Account CI/CD Pipeline for AWS Lambda" showing developers pushing code to a tooling account (Git repo, CloudWatch, artifact store/KMS) and a CI/CD pipeline (source, build, deploy). The pipeline deploys across accounts into "Unicorn" and "Gnome" AWS accounts using cross-account IAM roles to provision Lambda sample applications.
Limitations of multi-account pipelines
  • 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.
A slide titled "Multi-Account Pipelines in AWS – Limitations" showing four colored panels. Each panel lists a limitation: increased operational complexity, cross-account access setup, higher cost, and deployment latency, with corresponding icons.

Cross-account pipeline example (summary)

  1. A commit or merge to main fires an EventBridge event or repository webhook.
  2. CodePipeline in the tooling account kicks off a build & test stage (for example, CodeBuild).
  3. Artifacts are stored centrally (S3, CodeArtifact, or an external artifact repo).
  4. After tests pass, CodePipeline assumes a deployment role in the development account to perform the deploy.
  5. 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.
Example AWS CLI command to assume a cross-account role (for debugging or testing):

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.
In short: both single-account and multi-account pipelines are valid approaches. Single-account pipelines give simplicity and lower overhead; multi-account designs provide stronger isolation, security, and governance at the cost of additional complexity. Choose what aligns with your organization’s compliance needs, scale, and operational maturity. Further reading and references Thanks for following this lesson.

Watch Video