|
3 | 3 | This is the initial manual process to create a new environment like review, dev, production... |
4 | 4 |
|
5 | 5 | ## Code |
| 6 | + |
6 | 7 | - Create the configuration files in `infrastructure/environments/[environment]` |
7 | 8 | - Add the `[environment]:` target in `scripts/terraform/terraform.mk` |
8 | 9 | - Add [environment] to the list of environments in `deploy-stage` step of `cicd-2-main-branch.yaml`. For the review enviornment, there is a single item in `cicd-1-pull-request.yaml`. |
9 | 10 | - Set the `fetch_secrets_from_app_key_vault` terraform variable to `false`. This is to let terraform create the key vault and prevent reading before it is ready. |
10 | 11 |
|
11 | 12 | ## Entra ID |
| 13 | + |
12 | 14 | - Create postgres Entra ID group in `DTOS Administrative Unit (AU)`: `postgres_manbrs_[environment]_uks_admin` |
13 | 15 | - Ask CCOE to assign role: |
14 | | - - [Form for PIM](https://nhsdigitallive.service-now.com/nhs_digital?id=sc_cat_item&sys_id=28f3ab4f1bf3ca1078ac4337b04bcb78&sysparm_category=114fced51bdae1502eee65b9bd4bcbdc) |
15 | | - - Approver: Add someone from the infrastructure team |
16 | | - - Role Name: `Group.Read.All` |
17 | | - - Application Name: `mi-manbrs-[environment]-adotoaz-uks` |
18 | | - - Application ID: [client.id] |
19 | | - - Managed identity: `mi-manbrs-[environment]-adotoaz-uks` |
20 | | - - Description: |
21 | | - - Managed identity: `mi-manbrs-[environment]-adotoaz-uks` |
22 | | - - Role: permanent on Directory |
| 16 | + - [Form for PIM](https://nhsdigitallive.service-now.com/nhs_digital?id=sc_cat_item&sys_id=28f3ab4f1bf3ca1078ac4337b04bcb78&sysparm_category=114fced51bdae1502eee65b9bd4bcbdc) |
| 17 | + - Approver: Add someone from the infrastructure team |
| 18 | + - Role Name: `Group.Read.All` |
| 19 | + - Application Name: `mi-manbrs-[environment]-adotoaz-uks` |
| 20 | + - Application ID: [client.id] |
| 21 | + - Managed identity: `mi-manbrs-[environment]-adotoaz-uks` |
| 22 | + - Description: - Managed identity: `mi-manbrs-[environment]-adotoaz-uks` - Role: permanent on Directory |
23 | 23 |
|
24 | 24 | ## Bicep |
| 25 | + |
25 | 26 | - Run bicep from AVD: `make [environment] resource-group-init` |
26 | 27 |
|
27 | 28 | ## Infra secrets |
28 | | -- Add the infrastructure secrets to the *inf* key vault `kv-manbrs-[review]-inf` |
| 29 | + |
| 30 | +- Add the infrastructure secrets to the _inf_ key vault `kv-manbrs-[review]-inf` |
29 | 31 |
|
30 | 32 | ## Azure devops |
| 33 | + |
31 | 34 | - Create ADO group |
32 | | - - Name: `Run pipeline - [environment]` |
33 | | - - Members: `mi-manbrs-[environment]-ghtoado-uks`. There may be more than 1 in the list. Check client id printed below the name. |
34 | | - - Permissions: |
35 | | - - View project-level information |
| 35 | + - Name: `Run pipeline - [environment]` |
| 36 | + - Members: `mi-manbrs-[environment]-ghtoado-uks`. There may be more than 1 in the list. Check client id printed below the name. |
| 37 | + - Permissions: |
| 38 | + - View project-level information |
36 | 39 | - Create new pipeline: |
37 | | - - Name: `Deploy to Azure - [environment]` |
38 | | - - Pipeline yaml: `.azuredevops/pipelines/deploy.yml` |
| 40 | + - Name: `Deploy to Azure - [environment]` |
| 41 | + - Pipeline yaml: `.azuredevops/pipelines/deploy.yml` |
39 | 42 | - Manage pipeline security: |
40 | | - - Add group: `Run pipeline - [environment]` |
41 | | - - Permissions: |
42 | | - - Edit queue build configuration |
43 | | - - Queue builds |
44 | | - - View build pipeline |
45 | | - - View builds |
| 43 | + - Add group: `Run pipeline - [environment]` |
| 44 | + - Permissions: |
| 45 | + - Edit queue build configuration |
| 46 | + - Queue builds |
| 47 | + - View build pipeline |
| 48 | + - View builds |
46 | 49 | - Create service connection (ADO) |
47 | | - - Connection type: `Azure Resource Manager` |
48 | | - - Identity type: `Managed identity` |
49 | | - - Subscription for managed identity: `Digital Screening DToS - Devops` |
50 | | - - Resource group for managed identity: `rg-mi-[environment]-uks` |
51 | | - - Managed identity: `mi-manbrs-[environment]-adotoaz-uks` |
52 | | - - Scope level: `Subscription` |
53 | | - - Subscription: `Digital Screening DToS - Core Services Dev` |
54 | | - - Resource group for Service connection: leave blank |
55 | | - - Service Connection Name: `manbrs-[environment]` |
56 | | - - Do NOT tick: Grant access permission to all pipelines |
57 | | - - Security: allow `Deploy to Azure - [environment]` pipeline |
| 50 | + - Connection type: `Azure Resource Manager` |
| 51 | + - Identity type: `Managed identity` |
| 52 | + - Subscription for managed identity: `Digital Screening DToS - Devops` |
| 53 | + - Resource group for managed identity: `rg-mi-[environment]-uks` |
| 54 | + - Managed identity: `mi-manbrs-[environment]-adotoaz-uks` |
| 55 | + - Scope level: `Subscription` |
| 56 | + - Subscription: `Digital Screening DToS - Core Services Dev` |
| 57 | + - Resource group for Service connection: leave blank |
| 58 | + - Service Connection Name: `manbrs-[environment]` |
| 59 | + - Do NOT tick: Grant access permission to all pipelines |
| 60 | + - Security: allow `Deploy to Azure - [environment]` pipeline |
58 | 61 | - Create ADO environment: [environment] |
59 | | - - Set: exclusive lock (except for review) |
60 | | - - Add pipeline permission for `Deploy to Azure - [environment]` pipeline |
| 62 | + - Set: exclusive lock (except for review) |
| 63 | + - Add pipeline permission for `Deploy to Azure - [environment]` pipeline |
61 | 64 |
|
62 | 65 | ## Github |
| 66 | + |
63 | 67 | - Create Github environment [environment] |
64 | 68 | - Add the protection rule (except in review): |
65 | | - - Deselect `Allow administrators to bypass configured protection rules` |
66 | | - - In `Deployment branches and tags` choose `Selected branches and tags` from the drop-down menu |
67 | | - - Click `Add deployment branch or tag rule` and enter "main" |
| 69 | + - Deselect `Allow administrators to bypass configured protection rules` |
| 70 | + - In `Deployment branches and tags` choose `Selected branches and tags` from the drop-down menu |
| 71 | + - Click `Add deployment branch or tag rule` and enter "main" |
68 | 72 | - Add environment secrets, from `mi-manbrs-[environment]-ghtoado-uks` in github |
69 | | - - *AZURE_CLIENT_ID* |
70 | | - - *AZURE_SUBSCRIPTION_ID* |
| 73 | + - _AZURE_CLIENT_ID_ |
| 74 | + - _AZURE_SUBSCRIPTION_ID_ |
71 | 75 |
|
72 | 76 | ## First run |
| 77 | + |
73 | 78 | - Test running terraform manually from the AVD (Optional) |
74 | 79 | - Raise a pull request, review and merge to trigger the pipeline |
75 | 80 | - Check ADO pipeline. You may be prompted to authorise: |
76 | | - - Pipeline: service connection |
77 | | - - Environment: service connection and agent pool |
| 81 | + - Pipeline: service connection |
| 82 | + - Environment: service connection and agent pool |
78 | 83 |
|
79 | 84 | ## App secrets |
80 | | -- Add the application secrets to the *app* key vault `kv-manbrs-[review]-app` |
| 85 | + |
| 86 | +- Add the application secrets to the _app_ key vault `kv-manbrs-[review]-app` |
81 | 87 | - Set `fetch_secrets_from_app_key_vault` terraform variable to `true` |
82 | 88 | - Test running terraform manually from the AVD (Optional) |
83 | 89 | - Raise a pull request, review and merge to trigger the pipeline |
0 commit comments