Cross-Account Pipelines and Governance at Scale
Overview
Large organisations run hundreds of accounts. The challenge is to let teams ship quickly without giving up central control. The answer is a layered design: a tooling account that hosts pipelines, cross-account roles that grant just enough access, delegated administrators for security and operations services and organisation-wide policies and automation for tags, cost and compliance.
A good analogy is a franchise: the head office defines the brand standards and provides central supply (shared services, pipelines), while each outlet operates independently within those standards (workload accounts). Auditors visit the central ledger, not each shop.
This lesson ties together earlier chapters, covering cross-account deployment trust, resource sharing with RAM, tagging and cost governance, identity management with IAM Identity Center and organisation-wide observability, the style of design question that appears on DOP-C02.
Key Concepts
- Cross-account deployment: a pipeline role in the tooling account assumes a deployment role in the target account (trust policy with the pipeline principal); artifacts are decrypted via a shared customer managed KMS key.
- Delegated administrators (security, networking, backup, StackSets, Config, GuardDuty, Security Hub, IPAM, Firewall Manager) keep the management account minimal.
- AWS RAM shares resources such as VPC subnets, Transit Gateways, Route 53 resolver rules, License Manager configurations and Image Builder images within the organisation.
- Tag policies standardise tag keys/values; SCPs with aws:RequestTag/ aws:TagKeys conditions enforce required tags at creation; Config required-tags detects gaps.
- Cost governance: cost allocation tags, AWS Budgets with actions (apply SCP, stop instances), Cost Anomaly Detection, and Cost and Usage Reports to S3/Athena.
- IAM Identity Center provides workforce SSO with permission sets assigned to groups per account; avoid IAM users.
- Firewall Manager applies WAF, Shield, security group and Network Firewall policies organisation-wide; Backup policies and Config conformance packs extend this pattern.
- CloudWatch cross-account observability, central logging and Resource Explorer give a single operational pane across accounts.
Detailed Notes
Cross-account deployment trust
Target account role (PipelineDeployRole) trust policy:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": { "AWS": "arn:aws:iam::111122223333:role/PipelineRole" },
"Action": "sts:AssumeRole",
"Condition": { "StringEquals": { "sts:ExternalId": "orders-pipeline" } }
}]
}
Pipeline role permissions:
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::*:role/PipelineDeployRole"
}
The artifact bucket policy and KMS key policy in the tooling account grant read/decrypt to the target roles (see Chapter 1). Deploy roles are least-privileged: for CloudFormation actions the deploy role only needs iam:PassRole to a CloudFormation execution role that holds the resource permissions.
Architecture of a multi-account platform
| Account | Responsibility |
|---|---|
| Management | Organizations, billing, SCPs, Control Tower; no workloads |
| Log archive | Immutable central logs (CloudTrail, Config, Flow Logs) |
| Security / audit | Delegated admin for GuardDuty, Security Hub, Config, Inspector, Macie, Access Analyzer |
| Shared services / tooling | CI/CD pipelines, artifact repositories, Image Builder, central ECR |
| Network | Transit Gateway, Direct Connect, centralised egress/inspection, IPAM |
| Workload dev / test / prod | One account per application and environment (blast-radius isolation) |
Resource sharing with RAM
aws ram enable-sharing-with-aws-organization
aws ram create-resource-share --name shared-subnets \
--resource-arns arn:aws:ec2:us-east-1:444455556666:subnet/subnet-0abc \
--principals arn:aws:organizations::111122223333:ou/o-exampleorgid/ou-ab12-prod1234
Shared VPC subnets let many workload accounts deploy into centrally managed networks, while AMIs, Image Builder components and Service Catalog portfolios have similar sharing mechanisms.
Tagging and cost governance
{
"Effect": "Deny",
"Action": ["ec2:RunInstances", "rds:CreateDBInstance"],
"Resource": "*",
"Condition": { "Null": { "aws:RequestTag/CostCenter": "true" } }
}
Combine: tag policy (allowed values and case), SCP (require tag at creation), Config (detect), Cost Explorer / CUR (allocate). Activate cost allocation tags in Billing.
aws budgets create-budget --account-id $ACCT --budget file://budget.json \
--notifications-with-subscribers file://notify.json
# Budget actions can attach an SCP or IAM policy, or stop EC2/RDS when exceeded
Workforce identity
IAM Identity Center connects to your IdP (SAML/SCIM), maps groups to permission sets and assigns them to accounts/OUs. Sessions are short-lived and CLI access uses aws sso login. Replace long-lived IAM users and access keys, and use break-glass roles protected by MFA and monitoring.
Org-wide services map
| Need | Service |
|---|---|
| Firewall/WAF/security group policy everywhere | Firewall Manager |
| Central backup policy | AWS Backup + Organizations backup policy |
| Compliance packs | Config organisation conformance packs |
| Central logs | Organisation CloudTrail + log archive |
| Central findings | Security Hub + GuardDuty delegated admin |
| Operations visibility | Systems Manager Explorer, CloudWatch cross-account observability |
| IP planning | VPC IPAM |
| Multi-account app delivery | StackSets, CDK Pipelines, CodePipeline cross-account |
Governance workflow for a new workload
- Request an account (Account Factory) with OU placement.
- Lifecycle event triggers pipeline: baseline StackSets, tag policy attach, budgets, Identity Center assignment.
- Security services auto-enable; Config conformance pack deploys.
- Team pipelines in the tooling account deploy to the account using the deploy role.
- Continuous compliance reporting and cost allocation flow to central dashboards.
Exam heuristics for multi-account questions
- Prefer centralised, organisation-integrated features (service-managed StackSets, delegated admin, org conformance packs) to per-account scripts.
- Use roles, not users, and resource policies + roles for cross-account access.
- Keep management account clean; apply SCP guardrails at OU level; deny by default for risky services and Regions.
Real World Example
Scenario: a SaaS company moves to account-per-service. Every microservice has dev, test and prod accounts created by Account Factory. A tooling account runs CDK Pipelines that assume deploy roles in each target account, with artifacts encrypted by a shared CMK.
Networking is centralised: subnets are shared via RAM from a network account. Tag policies and SCPs force CostCenter and Owner tags; Budgets actions attach a restrictive SCP to a sandbox account that exceeds budget. Engineers use Identity Center permission sets, with no IAM users anywhere.
Architecture Diagram
Central accounts provide pipelines, security and networking to workload accounts.
- 1Account Factory creates a workload account in the right OU.
- 2Lifecycle automation applies baselines, budgets and identity assignments.
- 3The tooling account pipeline assumes the deploy role in each environment.
- 4Shared network and logging services are consumed through RAM and central buckets.
- 5Security and cost reporting aggregate in delegated administrator accounts.
Best Practices
- ✓Use one account per workload and environment for isolation and clear cost attribution.
- ✓Delegate security and operations services to dedicated accounts, not the management account.
- ✓Grant cross-account access with roles and least-privilege trust, and avoid IAM users.
- ✓Enforce tags with SCP + tag policies, and use Budgets actions for cost guardrails.
- ✓Centralise networking with RAM and Transit Gateway and logging in an immutable archive.
Common Interview Questions
Exam Tips
DOP-C02 focus
- "Share subnets or Transit Gateway across accounts" = RAM.
- "Run security service for all accounts from one account" = delegated administrator.
- "Block resource creation without a tag" = SCP with aws:RequestTag condition.
- "Remove IAM users for workforce" = IAM Identity Center with permission sets.
Finished this lesson?
0 of 44 lessons done · 0% of the course

