Adding a New Business Unit
- Request Accounts Created in Modernisation Platform
The accounts should be member accounts and should include both non-live and live environments.
For example:
container-platform-bu-nonlive
and
container-platform-bu-live
Modernisation Platform new account guide
Steps 2 - 6 Raise in one PR but do not merge until step 7 is complete.
- Add to the CP accounts.json
Add the account to the terraform/environments/cloud-platform/accounts.json file in the Modernisation Platform Environments repo.
- Create the Terraform Workspace
The Terraform workspace will automatically be created in the container-platform-bu application folder.
However, we run Terraform from the cloud-platform application folder, so we need to create the workspace there.
This should be done using the generate-account-workspaces.sh script. This ensures workspaces are created for all of the accounts in the accounts.json file.
Use AWS credentials for the platform-engineer-admin role in the cloud-platform-development account. (It just needs a role which has state access to cloud-platform.)
- Add Root Subdomain
In the cloud-platform root folder, add the subdomain for the business unit to the environment configuration.
- Add BU to Skip Plan Evaluator
Add the new accounts to the skip plan evaluator file in the MPE config folder.
- Add the VPC CIDR
Add the allocated VPC CIDR to the vpc_cidr block in network locals.
- RAM Share MP TGW to New Accounts
See code example here.
Raise the PR with the Modernisation Platform team. Merge before continuing to the next step.
PR example here
- Merge the Modernisation Environments Repository PR
Merge the PR and deploy to the new cluster environments. Note cluster plan will fail as the plan as the VPC have not yet been built. Cluster-core apply will fail with a Route53 hosted zone error.
See example PR here, this will need MP approval as well.
- Tag the new TGW attachments
In the core-network-services MP account, find the newly created TGW attachments, they will be the ones without Name tags. You can identify which one is which from the “Resource owner ID”.
When you identify them, add the Name tag, the name should be the same as the account name, e.g. container-platform-bu-nonlive and container-platform-bu-live. You will need an MP engineer to do this.
Note down the TGW ID for the next step.
- Add New TGW attachments to TGW Route Tables in MP
See code example here.
See PR example here
Get approval and merge PR.
- Add Route 53 Records for the New BU Subdomain
See code example here.
Find out the Route53 hosted zone NS records from each of the new business unit accounts and add them to the route53.tf file.
- Add the New BU to External DNS
See code example here.
- Apply Workflows to Build Out Clusters
PR example here
Approve and merge the PR. Then apply the cloud-platform and container-platform workflows.
- RAM share the route53 profiles from MP to the new BU accounts
https://github.com/ministryofjustice/modernisation-platform/pull/13516