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
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ module "my_backup" {

| Name | Description | Required | Default |
|------|-------------|-----------|---------|
| `resource_group_name` | The name of the resource group that is created to contain the vault - this cannot be an existing resource group. | Yes | n/a |
| `resource_group_location` | The location of the resource group that is created to contain the vault. | No | `uksouth` |
| `resource_group_name` | The name of the resource group that is created to contain the vault - the resource group will be created if `create_resource_group` = true, and must be an existing resource group if `create_resource_group` = false. | Yes | n/a |
| `resource_group_location` | The location of the resource group. | No | `uksouth` |
| `create_resource_group` | States whether a resource group should be created. Setting this to `false` means the vault will be deployed into an externally managed resource group, the name of which is defined in `resource_group_name`. | No | `true` |
| `backup_vault_name` | The name of the backup vault. The value supplied will be automatically prefixed with `rg-nhsbackup-`. If more than one az-backup module is created, this value must be unique across them. | Yes | n/a |
| `backup_vault_redundancy` | The redundancy of the vault, e.g. `GeoRedundant`. [See the following link for the possible values.](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/data_protection_backup_vault#redundancy) | No | `LocallyRedundant` |
Expand Down
28 changes: 14 additions & 14 deletions infrastructure/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions infrastructure/backup_vault.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ resource "azurerm_monitor_diagnostic_setting" "backup_vault" {
}
}

dynamic "metric" {
dynamic "enabled_metric" {
for_each = toset(local.backup_vault_diagnostics_metric_categories)
content {
category = metric.key
category = enabled_metric.key
}
}
}
2 changes: 0 additions & 2 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ terraform {
version = ">= 4.18.0, < 5.0"
}
}

backend "azurerm" {}
}
28 changes: 14 additions & 14 deletions tests/integration-tests/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/integration-tests/backup_vault.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ run "create_backup_vault" {
])
error_message = "Tags not as expected."
}

assert {
condition = azurerm_data_protection_backup_vault.backup_vault.immutability == var.backup_vault_immutability
error_message = "Backup vault immutability not as expected."
Expand Down Expand Up @@ -119,12 +119,12 @@ run "configure_vault_diagnostics_when_enabled" {
}

assert {
condition = length(azurerm_monitor_diagnostic_setting.backup_vault[0].metric) == length(local.backup_vault_diagnostics_metric_categories)
condition = length(azurerm_monitor_diagnostic_setting.backup_vault[0].enabled_metric) == length(local.backup_vault_diagnostics_metric_categories)
error_message = "Backup vault diagnostic setting metrics not as expected."
}

assert {
condition = alltrue([for metric in azurerm_monitor_diagnostic_setting.backup_vault[0].metric : contains(local.backup_vault_diagnostics_metric_categories, metric.category)])
condition = alltrue([for metric in azurerm_monitor_diagnostic_setting.backup_vault[0].enabled_metric : contains(local.backup_vault_diagnostics_metric_categories, metric.category)])
error_message = "Backup vault diagnostic setting metrics not as expected."
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration-tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "4.18.0"
version = ">= 4.18.0, < 5.0"
}
}
}