Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/acr-image-retag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

variables:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-dev-audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

variables:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-dev-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-int-audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

variables:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-int-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-nft-audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

variables:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-nft-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

variables:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-preprod-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-prod-audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

variables:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-prod-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/cd-infrastructure-sandbox-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/post-deployment-tests-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

variables:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/task_azure_sql_backup_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

variables:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/task_azure_sql_scaling_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/task_azure_sql_scaling_int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/task_azure_sql_scaling_nft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/task_azure_sql_scaling_preprod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
2 changes: 1 addition & 1 deletion .azuredevops/pipelines/task_azure_sql_scaling_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ resources:
- repository: dtos-devops-templates
type: github
name: NHSDigital/dtos-devops-templates
ref: ede5951c59bd3a06bad1dc81d33d44e2ddd8e018
ref: 8d9323116e7e0442e3f89750df39af27a2e1a4a7
endpoint: NHSDigital

parameters:
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/tf-core/key_vault.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ module "key_vault" {
resource_group_name = azurerm_resource_group.core[each.key].name
location = each.key

enable_alerting = var.features.alerts_enabled
action_group_id = var.features.alerts_enabled ? module.monitor_action_group_performance[0].monitor_action_group.id : null
secret_near_expiry_alert = var.key_vault.secret_near_expiry_alert
secret_expired_alert = var.key_vault.secret_expired_alert
log_analytics_workspace_id = data.terraform_remote_state.audit.outputs.log_analytics_workspace_id[local.primary_region]
monitor_diagnostic_setting_keyvault_enabled_logs = local.monitor_diagnostic_setting_keyvault_enabled_logs
monitor_diagnostic_setting_keyvault_metrics = local.monitor_diagnostic_setting_keyvault_metrics
Expand Down
6 changes: 1 addition & 5 deletions infrastructure/tf-core/monitor_action_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ module "monitor_action_group_performance" {
email_receiver = {
email = {
name = "email"
email_address = data.azurerm_key_vault_secret.monitoring_email_address[local.primary_region].value
email_address = var.MONITORING_EMAIL_ADDRESS
}
}

depends_on = [
module.key_vault
]
}
17 changes: 17 additions & 0 deletions infrastructure/tf-core/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ variable "HUB_SUBSCRIPTION_ID" {
type = string
}

variable "MONITORING_EMAIL_ADDRESS" {
description = "The email address for monitoring alerts"
type = string
}

variable "TARGET_SUBSCRIPTION_ID" {
description = "ID of a subscription to deploy infrastructure"
type = string
Expand Down Expand Up @@ -353,6 +358,18 @@ variable "key_vault" {
soft_del_ret_days = optional(number, 7)
purge_prot = optional(bool, false)
sku_name = optional(string, "standard")

secret_near_expiry_alert = optional(object({
evaluation_frequency = optional(string, "P1D") # every 24 hours
window_duration = optional(string, "P1D") # last 24 hours
threshold = optional(number, 1)
}), {})

secret_expired_alert = optional(object({
evaluation_frequency = optional(string, "PT15M") # every 15 mins
window_duration = optional(string, "PT1H") # last 1 hour
threshold = optional(number, 1)
}), {})
})
}

Expand Down
Loading