External pipeline deployment
In a default Landing Zone Accelerator on AWS installation, the CodePipeline and CodeCommit configuration repository deploys into the AWS Organizations management account. You may want to deploy and operate these components in a member AWS account to limit access to the management account. This solution supports this model with an optional pipeline deployment account.
Follow these instructions to implement this pattern:
-
Select an AWS account for the pipeline deployment account. We recommend having the account as a member of the AWS Organizations environment.
-
Create a new IAM role in the AWS Organizations management account that allows access from the pipeline deployment account.
AcceleratorPipelineDeploymentRole
is the preferred name for this role. -
Update the trust policy of the
AcceleratorPipelineDeploymentRole
to allow access from the pipeline deployment account:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:sts::<PIPELINE_DEPLOYMENT_ACCOUNT_ID>:assumed-role/AcceleratorPipelineDeploymentRole" }, "Action": "sts:AssumeRole" } ] }
-
Attach the
AdministratorAccess
AWS managed IAM policy to the role.
After you create the IAM role in the management account, synthesize the Landing Zone Accelerator on AWS installer template configured for external deployments by following these instructions:
-
Clone or download the latest release of the Landing Zone Accelerator on AWS source code
. -
Navigate to the
source
folder:cd landing-zone-accelerator-on-aws/source
-
Install dependencies and build the source code:
yarn install && yarn build
-
Navigate to the installer folder:
cd packages/\@aws-accelerator/installer/
-
Synthesize the installer template by running:
cdk synth --context use-external-pipeline-account=true
-
Retrieve the synthesize template named
AWSAccelerator-InstallerStack.template.json
from thecdk.out
directory. -
Use this template to create the
AWSAccelerator-Installer
CloudFormation stack in the external deployment account. -
The deployment now follows the same process as the standard deployment process with the addition of the following parameters:
-
AcceleratorQualifier - Names the resources in the external deployment account. This must be unique for each Landing Zone Accelerator on AWS pipeline created in a single external deployment account.
-
ManagementAccountId - This is the AWS account ID of the AWS Organizations management account.
-
ManagementAccountRoleName - This is the name of the IAM role used to access the management account from the external deployment account.
-