src/config/landing-zone-settings.ts contains the core deployment boundary for your landing zone. These values are read by every stack and StackSet to wire names, targets, and regions correctly.
Two account IDs anchor the deployment. The management account is your AWS Organizations root, where the organization phase runs. The landing zone account is a dedicated member account that deploys the StackSet stacks as the CloudFormation StackSets delegated administrator, so day-to-day provisioning does not run from the management account. See Stacks for how the two phases relate.
After changing this file, re-run pnpm exec projen to regenerate the npm scripts and GitHub Actions workflow with the updated values.
Options
| Option | Type | Required | Description |
|---|---|---|---|
organizationName | string | Yes | Short organization slug used in resource names, such as the landing zone asset buckets (<organizationName>-landing-zone-assets). Use lowercase and dashes. |
mailDomain | string | Yes | Email domain used to generate root email addresses for new AWS accounts (e.g. aws+security@your-org.com). |
managementAccountId | string | Yes | 12-digit AWS Organizations management account ID. The organization phase deploys here. |
landingZoneAccountId | string | No* | 12-digit ID of the dedicated member account that deploys the landing zone StackSets as the CloudFormation StackSets delegated administrator. Leave it unset only for the very first organization-phase deploy; set it before you deploy the landing-zone phase. *Required to deploy the landingzone phase. |
primaryRegion | string | Yes | Primary AWS Region where the CDK app and landing zone resources deploy. |
secondaryRegions | string[] | Yes | Additional active Regions that receive multi-Region StackSet deployments. Pass [] if you only use one Region. With primaryRegion, at most 15 Regions in total. |
externalAdmins | LandingZoneExternalAdmin[] | No | Enables an ExternalAccessStackSet that grants one or more third-party accounts admin access across organization accounts. Each entry takes accountId (string, required), managedPolicyName (string, optional, default ReadOnlyAccess), and roleName (string, optional, default ExternalLandingZoneAdmin-<accountId>). |
organizationAccountLimit | number | No | Desired AWS Organizations maximum-accounts quota. When set, the Provision Management StackSet requests it against the management account. The request is idempotent and approval is asynchronous. |
auditLogRemovalPolicy | cdk.RemovalPolicy | No | What removing the landing zone does to the organization's audit logs. Default cdk.RemovalPolicy.RETAIN. cdk.RemovalPolicy.DESTROY deletes the logs; see Things to know. |
auditLogRetention | cdk.Duration | No | How long the organization trail's log bucket and its access-log bucket keep their objects before S3 expires them. A whole number of days. Default cdk.Duration.days(365). |
Example
The starter ships the file with the optional settings commented out. Uncomment the ones you need:
export const landingZoneSettings: LandingZoneSettings = {
organizationName: 'example-corp',
mailDomain: 'example.com',
managementAccountId: '111111111111',
landingZoneAccountId: '222222222222',
primaryRegion: 'eu-west-1',
secondaryRegions: [],
// externalAdmins: [
// {
// accountId: '111122223333',
// managedPolicyName: 'ReadOnlyAccess',
// },
// ],
// organizationAccountLimit: 120,
};
The audit log settings take CDK values. With them set, the object gains two lines such as auditLogRemovalPolicy: cdk.RemovalPolicy.RETAIN and auditLogRetention: cdk.Duration.days(730).
How it's used
These settings flow into every part of the landing zone:
organizationNameandmailDomainprefix the generated account email addresses and name the landing zone asset buckets; the OU and account display names in organization-structure.ts are plain stringsmanagementAccountId,landingZoneAccountId, andprimaryRegionare embedded in the generatedorganization:*andlandingzone:*npm scripts and the two-account GitHub Actions deployment workflow bypnpm exec projenprimaryRegionandsecondaryRegionsdetermine which Regions the region-guardrail SCP allows (see Service Control Policies) and which Regions the multi-Region StackSets, such as Account Security, target. The landing zone also keeps one asset bucket per active Region, so adding or removing a secondary Region adds or removes that bucket in the samelandingzonedeploymentexternalAdminsdeploys anExternalAccessStackSetacross the organization when setorganizationAccountLimitis passed into theProvisionManagementStackSet, which requests the quota against the management account when setauditLogRemovalPolicyandauditLogRetentionapply to the organization trail that the Observability StackSet runs in the observability account, and to its log and access-log buckets and encryption key
Things to know
- Re-run
pnpm exec projenafter every change to this file, as the generated workflow and npm scripts embedmanagementAccountId,landingZoneAccountId, andprimaryRegiondirectly landingZoneAccountIdhas a bootstrapping quirk: leave it unset for the first organization-only deploy, then set it to the ID of theLandingZoneAccountthat the organization phase creates and re-runpnpm exec projenbefore deploying the landing-zone phase. Install walks through this orderingorganizationNameshould be stable: it names the asset buckets, and changing it creates new ones- Email addresses for accounts must be globally unique across all of AWS; the
mailDomainapproach usingaws+<alias>@your-domain.comkeeps them namespaced under your domain - Audit logs under
RETAIN(the default). Removing the landing zone keeps the organization trail's log bucket, access-log bucket, and encryption key, so existing log files stay readable and the trail keeps delivering into the retained buckets. The CloudWatch Logs delivery and the CIS alarms are removed. Removing the organization stack also disables CloudTrail trusted access, which turns the organization trail into a management-account trail: member accounts are no longer logged until a reinstall restores it. Nothing deletes the retained buckets or key. A reinstall creates new buckets and a new key next to them, and the retained log files stay readable with the retained key. - Audit logs under
DESTROY. Removal empties and deletes the buckets and deletes the trail and its key. Use it only for an organization whose audit logs are disposable, such as a test organization. Empty a large bucket yourself first. - Shorter retention deletes logs.
auditLogRetentionexpires both the audit log files and the S3 server access logs after that many days, so lower it only when you keep copies elsewhere. - Secondary Regions. Removing a Region from
secondaryRegionsremoves the landing zone's StackSet instances there in the nextlandingzonedeployment. The Region's asset bucket, and its entry in the region-guardrail SCP, stay until no landing-zone StackSet uses the Region anymore, so a deployment that fails during the removal can roll back. A later deployment then removes both.
Workload account quota requests belong in service-quotas.ts. Use organizationAccountLimit here only for the management account's Organizations account quota.