Source code location
In a default Landing Zone Accelerator on AWS deployment, CodePipeline retrieves the source code from the solution’s GitHub repository
Follow these instructions to implement this pattern:
-
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.
-
Clone or download the latest release of the Landing Zone Accelerator on AWS source code
. -
Navigate to the landing-zone-accelerator-on-aws folder:
cd landing-zone-accelerator-on-aws -
Compress all files and folders inside the landing-zone-accelerator-on-aws folder into a versioned zip archive file and upload it to your S3 bucket:
SOURCE_CODE_BUCKET_NAME=YOUR_BUCKET_NAME LZA_VERSION=v1.14.2 zip -q -T -r ../$LZA_VERSION.zip . # quiet, test integrity, recursive aws s3 cp ../$LZA_VERSION.zip s3://$SOURCE_CODE_BUCKET_NAME/release/$LZA_VERSION.zipNote
Replace
v1.14.2with the actual LZA version you are deploying. The zip file must contain all the contents inside the landing-zone-accelerator-on-aws folder or the build will fail. -
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-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
-
Retrieve the synthesize template named
AWSAccelerator- InstallerStack.template.jsonfrom the cdk.out directory. -
Use this template to create the
AWSAccelerator-InstallerCloudFormation stack in the account and region the S3 bucket was created in. -
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.
-