Skip to content

Commit ccbb287

Browse files
feat(lza-upgrade): add doc and options to set which LZA version to install (#1301)
* chore: doc to use specific LZA version * add option to configure a different installer stack * add doc to use installer stack for a specific version
1 parent 8c86b26 commit ccbb287

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

reference-artifacts/Custom-Scripts/lza-upgrade/src/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ export interface Config {
3636
skipDriftDetection?: boolean;
3737
localConfigFilePath?: string;
3838
enableTerminationProtection?: boolean;
39+
lzaInstallerTemplateBucket?: string
40+
lzaInstallerTemplateKey?: string
3941
}

reference-artifacts/Custom-Scripts/lza-upgrade/src/preparation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ export class Preparation {
5555
}
5656

5757
async prepareLza() {
58-
await getLZAInstallerStackTemplate('solutions-reference');
58+
await getLZAInstallerStackTemplate(this.config.lzaInstallerTemplateBucket ?? 'solutions-reference',
59+
this.config.lzaInstallerTemplateKey ?? 'landing-zone-accelerator-on-aws/latest/AWSAccelerator-InstallerStack.template');
5960
await putLZAInstallerStackTemplate(this.config.aseaConfigBucketName, this.homeRegion);
6061
const installerStackParameters: InstallerStackParameters = {
6162
repositorySource: this.config.lzaCodeRepositorySource ?? 'github',

reference-artifacts/Custom-Scripts/lza-upgrade/src/preparation/aws-lza.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ export async function createLZAInstallerCloudFormationStack(
147147
}
148148
}
149149

150-
export async function getLZAInstallerStackTemplate(bucketName: string) {
150+
export async function getLZAInstallerStackTemplate(bucketName: string, objectKey: string) {
151151
const s3Client = new S3Client({ endpoint: 'https://s3.amazonaws.com', region: 'us-east-1' });
152152
const template = await s3Client.send(
153153
new GetObjectCommand({
154154
Bucket: bucketName,
155-
Key: 'landing-zone-accelerator-on-aws/latest/AWSAccelerator-InstallerStack.template',
155+
Key: objectKey,
156156
}),
157157
);
158158

src/mkdocs/docs/lza-upgrade/faq.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,27 @@ ORDER BY
8585
```
8686

8787
For more information about LZA related Quotas, refer to the [LZA Documentation about Quotas](https://docs.aws.amazon.com/solutions/latest/landing-zone-accelerator-on-aws/quotas.html) as well as this note about [CodeBuild concurrency](https://docs.aws.amazon.com/solutions/latest/landing-zone-accelerator-on-aws/prerequisites.html#update-codebuild-conncurrency-quota)
88+
89+
## What version of LZA will be installed?
90+
91+
By default, the LZA upgrade tools install the latest LZA official release. To specify a version to use, follow these instructions:
92+
93+
1. Run `yarn migration-config` from the [Preparation phase](./preparation/prereq-config.md#configuration)
94+
2. Edit the `src/input-config/input-config.json` file
95+
3. Add the following property to the file to specify which branch to use: `"lzaCodeRepositoryBranch": "release/<version>"`
96+
4. Add the following property to specify the path of the CloudFormation installer template from the solution reference bucket `"lzaInstallerTemplateKey": "landing-zone-accelerator-on-aws/<version>/AWSAccelerator-InstallerStack.template"`
97+
5. Follow the remaining steps of the upgrade. This configuration will be used when you install LZA using the `yarn run lza-prep` command in the [Upgrade phase](./upgrade/install-lza.md)
98+
99+
!!! info
100+
The `lzaCodeRepositoryBranch` and `lzaInstallerTemplateKey` should match the same LZA version. For example, to install version `v1.12.6` you should have the following properties in your `input-config.json` file.
101+
102+
```json
103+
"lzaCodeRepositoryBranch": "release/v1.12.6",
104+
"lzaInstallerTemplateKey": "landing-zone-accelerator-on-aws/v1.12.6/AWSAccelerator-InstallerStack.template"
105+
```
106+
107+
The latest CloudFormation installer template is available from the [LZA Implementation Guide](https://docs.aws.amazon.com/solutions/latest/landing-zone-accelerator-on-aws/aws-cloudformation-template.html). Previous versions are accessible by changing the version number in the Url.
108+
109+
110+
!!! tip "When to use a specific version"
111+
If you are upgrading Non-Production and Production environments we recommend that you use the same version for both environments to replicate the same results. You can update to the latest LZA version once you upgraded from ASEA to LZA.

src/mkdocs/docs/lza-upgrade/preparation/prereq-config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ yarn run migration-config
9696
!!! info
9797
By default the upgrade tool uses `ca-central-1` as the home region. If you use a different home region you need to set the AWS_REGION environment variable before running `migration-config`. e.g. `AWS_REGION=eu-west-1 yarn run migration-config`
9898

99+
By default the upgrade tool install the latest LZA official release. To specify a version to use see the [FAQ](../faq.md#what-version-of-lza-will-be-installed)
100+
99101
??? abstract "Detailed information"
100102
This command will also deploy a CloudFormation template and create two CodeCommit repositories. The CloudFormation template will create an S3 bucket for the resource mapping files. The first CodeCommit repository will also be used for the resource mapping files. The second CodeCommit repository will be used for the Landing Zone Accelerator configuration files that will be created in a later step.
101103

0 commit comments

Comments
 (0)