Source code location - Landing Zone Accelerator on AWS

Source code location

In a default Landing Zone Accelerator on AWS deployment, CodePipeline retrieves the source code from the solution’s GitHub repository. You may want to instead store the source code in Amazon S3 to use only Amazon-provided products. This solution supports this operating model by uploading the LZA source code to an existing S3 bucket before deploying the solution.

Follow these instructions to implement this pattern:

  1. Create an S3 bucket with versioning enabled. This bucket should be created in the same AWS account and region you plan to deploy the Landing Zone Accelerator on AWS solution.

  2. Clone or download the latest release of the Landing Zone Accelerator on AWS source code.

  3. Navigate to the source folder:

    cd landing-zone-accelerator-on-aws/source
  4. Compress the contents of the source folder into a new zip archive file.

  5. Upload the zip archive to the S3 bucket created in Step 1.

  6. Install dependencies and build the source code:

    yarn install && yarn build
  7. Navigate to the installer folder:

    cd packages/\@aws-accelerator/installer/
  8. Synthesize the installer template by running:

    cdk synth -context use-s3-source=true
Note

If your S3 bucket is encrypted with KMS (S3-KMS), you must pass the KMS key ID when synthesizing the template:

cdk synth -context use-s3-source=true --context s3-source-kms-key-arn=arn:aws:kms:us-east-1:000000000000:key/aaaaaaaa-1111-bbbb-2222-cccccc333333
  1. Retrieve the synthesize template named AWSAccelerator- InstallerStack.template.json from the cdk.out directory.

  2. Use this template to create the AWSAccelerator-Installer CloudFormation stack in the account and region the S3 bucket was created in.

  3. The deployment now follows the same process as the standard deployment process with the addition of the following parameters:

    • RepositoryBucketName - The name of the S3 bucket used to contain the source code.

    • RepositoryBucketObject - The S3 object key of the source code uploaded in Step 5.

    • RepositoryBucketKmsKeyArn - (OPTIONAL) The ARN of the KMS key used to encrypt the S3 bucket.