Skip to content

Commit 8ff065e

Browse files
authored
feat: Update TF provider version in Audit environments (#963)
* Update TF version in Audit * Add sandbox yaml for comparison run * Add sandbox yaml for comparison run
1 parent 0afdd6f commit 8ff065e

File tree

9 files changed

+163
-13
lines changed

9 files changed

+163
-13
lines changed

.azuredevops/pipelines/cd-infrastructure-dev-audit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
- repository: dtos-devops-templates
1414
type: github
1515
name: NHSDigital/dtos-devops-templates
16-
ref: 2f8731f9c7d6b9d53b7044979e381377b2c85bcd
16+
ref: c00889236a258a52a2f3131272427ce81d4da951
1717
endpoint: NHSDigital
1818

1919
variables:
@@ -22,7 +22,7 @@ variables:
2222
- name: TF_DIRECTORY
2323
value: $(System.DefaultWorkingDirectory)/$(System.TeamProject)/infrastructure/tf-audit
2424
- name: TF_VERSION
25-
value: 1.9.2
25+
value: 1.11.4
2626
- name: TF_PLAN_ARTIFACT
2727
value: tf_plan_audit_DEV
2828
- name: ENVIRONMENT

.azuredevops/pipelines/cd-infrastructure-devtest-audit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
- repository: dtos-devops-templates
1414
type: github
1515
name: NHSDigital/dtos-devops-templates
16-
ref: 2f8731f9c7d6b9d53b7044979e381377b2c85bcd
16+
ref: c00889236a258a52a2f3131272427ce81d4da951
1717
endpoint: NHSDigital
1818

1919
variables:
@@ -22,7 +22,7 @@ variables:
2222
- name: TF_DIRECTORY
2323
value: $(System.DefaultWorkingDirectory)/$(System.TeamProject)/infrastructure/tf-audit
2424
- name: TF_VERSION
25-
value: 1.9.2
25+
value: 1.11.4
2626
- name: TF_PLAN_ARTIFACT
2727
value: tf_plan_audit_DEVTEST
2828
- name: ENVIRONMENT

.azuredevops/pipelines/cd-infrastructure-int-audit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
- repository: dtos-devops-templates
1414
type: github
1515
name: NHSDigital/dtos-devops-templates
16-
ref: 2f8731f9c7d6b9d53b7044979e381377b2c85bcd
16+
ref: c00889236a258a52a2f3131272427ce81d4da951
1717
endpoint: NHSDigital
1818

1919
variables:
@@ -22,7 +22,7 @@ variables:
2222
- name: TF_DIRECTORY
2323
value: $(System.DefaultWorkingDirectory)/$(System.TeamProject)/infrastructure/tf-audit
2424
- name: TF_VERSION
25-
value: 1.9.2
25+
value: 1.11.4
2626
- name: TF_PLAN_ARTIFACT
2727
value: tf_plan_audit_INT
2828
- name: ENVIRONMENT

.azuredevops/pipelines/cd-infrastructure-nft-audit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
- repository: dtos-devops-templates
1414
type: github
1515
name: NHSDigital/dtos-devops-templates
16-
ref: 2f8731f9c7d6b9d53b7044979e381377b2c85bcd
16+
ref: c00889236a258a52a2f3131272427ce81d4da951
1717
endpoint: NHSDigital
1818

1919
variables:
@@ -22,7 +22,7 @@ variables:
2222
- name: TF_DIRECTORY
2323
value: $(System.DefaultWorkingDirectory)/$(System.TeamProject)/infrastructure/tf-audit
2424
- name: TF_VERSION
25-
value: 1.9.2
25+
value: 1.11.4
2626
- name: TF_PLAN_ARTIFACT
2727
value: tf_plan_audit_NFT
2828
- name: ENVIRONMENT

.azuredevops/pipelines/cd-infrastructure-preprod-audit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resources:
1313
- repository: dtos-devops-templates
1414
type: github
1515
name: NHSDigital/dtos-devops-templates
16-
ref: 2f8731f9c7d6b9d53b7044979e381377b2c85bcd
16+
ref: c00889236a258a52a2f3131272427ce81d4da951
1717
endpoint: NHSDigital
1818

1919
variables:
@@ -22,7 +22,7 @@ variables:
2222
- name: TF_DIRECTORY
2323
value: $(System.DefaultWorkingDirectory)/$(System.TeamProject)/infrastructure/tf-audit
2424
- name: TF_VERSION
25-
value: 1.9.2
25+
value: 1.11.4
2626
- name: TF_PLAN_ARTIFACT
2727
value: tf_plan_audit_PRE
2828
- name: ENVIRONMENT
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
3+
name: $(Build.SourceBranchName)-$(Date:yyyyMMdd)_$(Rev:r)
4+
trigger: none
5+
pr: none
6+
7+
pool:
8+
#vmImage: ubuntu-latest
9+
name: private-pool-dev-uks
10+
11+
resources:
12+
repositories:
13+
- repository: dtos-devops-templates
14+
type: github
15+
name: NHSDigital/dtos-devops-templates
16+
ref: c00889236a258a52a2f3131272427ce81d4da951
17+
endpoint: NHSDigital
18+
19+
parameters:
20+
- name: pipelineAction
21+
displayName: 'Pipeline Action'
22+
type: string
23+
values:
24+
- 'PlanOnly'
25+
- 'Apply'
26+
- 'Destroy'
27+
default: 'Apply'
28+
29+
variables:
30+
- group: SBX_audit_backend
31+
- group: DEV_hub_backend_remote_state
32+
- name: TF_DIRECTORY
33+
value: $(System.DefaultWorkingDirectory)/$(System.TeamProject)/infrastructure/tf-audit
34+
- name: TF_VERSION
35+
value: 1.11.4
36+
- name: TF_PLAN_ARTIFACT
37+
value: tf_plan_audit_SANDBOX
38+
- name: ENVIRONMENT
39+
value: sandbox
40+
41+
stages:
42+
- stage: terraform_plan
43+
displayName: Terraform Plan
44+
condition: and(in('${{ parameters.pipelineAction }}', 'Apply', 'PlanOnly'), eq(variables['Build.Reason'], 'Manual'))
45+
variables:
46+
tfVarsFile: environments/$(ENVIRONMENT).tfvars
47+
jobs:
48+
- job: init_and_plan
49+
displayName: Init, plan, store artifact
50+
steps:
51+
- checkout: self
52+
- checkout: dtos-devops-templates
53+
- template: .azuredevops/templates/steps/tf_plan.yaml@dtos-devops-templates
54+
55+
- stage: terraform_apply
56+
displayName: Terraform Apply
57+
dependsOn: [terraform_plan]
58+
condition: and(eq('${{ parameters.pipelineAction }}', 'Apply'), eq(dependencies.terraform_plan.outputs['init_and_plan.TerraformPlan.changesPresent'], 'true'), eq(variables['Build.Reason'], 'Manual'))
59+
jobs:
60+
- deployment: terraform_apply
61+
displayName: Init, get plan artifact, apply
62+
environment: $(ENVIRONMENT)
63+
strategy:
64+
runOnce:
65+
deploy:
66+
steps:
67+
- checkout: self
68+
- checkout: dtos-devops-templates
69+
- template: .azuredevops/templates/steps/tf_apply.yaml@dtos-devops-templates
70+
71+
- stage: terraform_destroy
72+
displayName: Terraform Destroy
73+
condition: and(eq('${{ parameters.pipelineAction }}', 'Destroy'), eq(variables['Build.Reason'], 'Manual'))
74+
variables:
75+
tfVarsFile: environments/$(ENVIRONMENT).tfvars
76+
jobs:
77+
- deployment: terraform_destroy
78+
displayName: Terraform Destroy
79+
environment: $(ENVIRONMENT)
80+
strategy:
81+
runOnce:
82+
deploy:
83+
steps:
84+
- checkout: self
85+
- checkout: dtos-devops-templates
86+
- template: .azuredevops/templates/steps/tf_destroy.yaml@dtos-devops-templates
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
application = "cohman"
2+
application_full_name = "cohort-manager"
3+
environment = "SBX"
4+
5+
features = {
6+
private_endpoints_enabled = true
7+
private_service_connection_is_manual = false
8+
public_network_access_enabled = false
9+
log_analytics_data_export_rule_enabled = false
10+
}
11+
12+
tags = {
13+
Project = "Cohort-Manager"
14+
}
15+
16+
regions = {
17+
uksouth = {
18+
is_primary_region = true
19+
address_space = "10.127.0.0/16"
20+
connect_peering = true
21+
subnets = {
22+
pep = {
23+
cidr_newbits = 8
24+
cidr_offset = 1
25+
}
26+
}
27+
}
28+
}
29+
30+
app_insights = {
31+
appinsights_type = "web"
32+
}
33+
34+
law = {
35+
law_sku = "PerGB2018"
36+
retention_days = 30
37+
export_enabled = false
38+
export_table_names = ["Alert"]
39+
}
40+
41+
storage_accounts = {
42+
sqllogs = {
43+
name_suffix = "sqllogs"
44+
account_tier = "Standard"
45+
replication_type = "LRS"
46+
public_network_access_enabled = false
47+
blob_properties_delete_retention_policy = 7
48+
blob_properties_versioning_enabled = true
49+
containers = {
50+
vulnerability-assessment = {
51+
container_name = "vulnerability-assessment"
52+
container_access_type = "private"
53+
}
54+
}
55+
56+
}
57+
}

infrastructure/tf-audit/outputs.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2+
output "application_insights" {
3+
value = {
4+
name = module.app_insights_audit[local.primary_region].name
5+
resource_group_name = module.app_insights_audit[local.primary_region].resource_group_name
6+
}
7+
}
8+
19
output "log_analytics_workspace_id" {
210
value = { for k, v in module.log_analytics_workspace_audit : k => v.id }
311
}

infrastructure/tf-audit/providers.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ terraform {
33
required_version = ">= 1.9.2"
44
required_providers {
55
azurerm = {
6-
source = "hashicorp/azurerm"
7-
# version = ">= 4.2.0"
8-
version = "= 3.112.0"
6+
source = "hashicorp/azurerm"
7+
version = "4.26"
98
}
109
azuread = {
1110
source = "hashicorp/azuread"

0 commit comments

Comments
 (0)