The LzConfigure.ps1 PowerShell script is run on the Management Workstation to configure your SMF Organization.
This script was used in the initial SMF setup to create a GitHub Organization configured wih:
The first time you run the AzConfigure script, a SMF.yaml file is written in your LazyStackSettings folder. This file contains the configuration settings for your SMF Organization. Here is a sample SMF.yaml file generated for our made-up organization with an OrgCode of "Az" and a GitHub organization name of "AzOrg".
Az:
AWS:
MgmtProfile: AzMgmt
DefaultRegion: us-east-1
OrgUnits:
- DevOU
- TestOU
- ProdOU
Sources:
GitHub:
Type: GitHub
AcctName: AzAdmin
OrgName: AzOrg
Systems:
Tut:
Description: Tutorial System
Accounts:
Test:
Type: Test
DefaultRegion: us-east-1
Description: Test System Account
Pipelines:
Test_PR_Create:
Description: Create PR Stack on Pull Request Creation
TemplatePath: ../LazyStackSMF/Test_CodeBuild_PR_Create.yaml
Region: us-east-1
TemplateParams:
RepoParam: https://github.com/AzOrg/Petstore.git
UtilRepoParam: https://github.com/AzOrg/LazyStackSMF.git
Test_PR_Merge:
Description: Delete PR Stack on Pull Request Merge
TemplatePath: ../LazyStackSMF/Test_CodeBuild_PR_Merge.yaml
Region: us-east-1
TemplateParams:
RepoParam: https://github.com/AzOrg/Petstore.git
Prod:
Type: Prod
Description: Prod System Account
Pipelines:
Prod_PR_Merge:
Description: Update Production Stack on Pull Request Merge
TemplatePath: ../LazyStackSMF/Prod_CodeBuild_PR_Merge.yaml
Region: us-east-1
TemplateParams:
RepoParam: https://github.com/AzOrg/Petstore.git
UtilRepoParam: https://github.com/AzOrg/LazyStackSMF.git
ProdStackNameParam: us-east-1-petstore
The hierarchy of this document reflects the organization diagrams previously shown:
It is very easy to add additional systems (each containing a test and production account with CI/CD pipelines). You can copy an existing system (like Tut), paste it into the SMF file, give it a new SysCode, and then edit Pipeline properties as necessary. Typically, this would mean changing the RepoParm value on each Pipeline under the new system.
After making these changes you simply run the LzConfigure script and it will create the new AWS Accounts and deploy the new pipeline projects.
NOTE: AWS limits new Organizations to having 4 Accounts. Each time you add a new system you are adding 2 new accounts. Before configuring a new System, request that AWS increase the maximum number of accounts limt in your organization.
Adding a new Serverless Stack to a System is accomplished by adding additional pipelines under the existing System Accounts. Use the existing pipelines as an example. Each Pipeline must have a unique name under the Pipelines section.
After making these changes you simply run the LzConfigure script and it will create and deploy the new pipeline projects.
Each new AWS Account needs a unique email address or alias. Have these handy before you run the script.
..\LazyStackSMF\LzConfigure.ps1