Skip to content

Commit 52ff143

Browse files
authored
Merge pull request #10 from bebyx/bug/primary-identity
Add missing primary_user_assigned_identity_id parameter
2 parents 48c987e + 0faa585 commit 52ff143

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ module "sql_single" {
248248
| outbound\_network\_restriction\_enabled | Whether outbound network traffic is restricted for this server. | `bool` | `false` | no |
249249
| point\_in\_time\_backup\_interval\_in\_hours | The hours between each differential backup. This is only applicable to live databases but not dropped databases. Value has to be 12 or 24. Defaults to 12 hours. | `number` | `12` | no |
250250
| point\_in\_time\_restore\_retention\_days | Point In Time Restore configuration. Value has to be between `7` and `35`. | `number` | `7` | no |
251+
| primary\_user\_assigned\_identity\_id | Specifies the primary user managed identity id. Required if type within the identity block is set to either SystemAssigned, UserAssigned or UserAssigned and should be set at same time as setting identity\_ids. | `string` | `null` | no |
251252
| public\_network\_access\_enabled | True to allow public network access for this server. | `bool` | `false` | no |
252253
| resource\_group\_name | Resource group name. | `string` | n/a | yes |
253254
| security\_storage\_account\_access\_key | Storage Account access key used to store security logs and reports. | `string` | `null` | no |

r-db.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ resource "azurerm_mssql_database" "main" {
7979
dynamic "short_term_retention_policy" {
8080
# For elastic pool databases, exclude the block for HS SKUs
8181
# For single databases, always include the block
82-
for_each = var.elastic_pool_enabled && startswith(local.elastic_pool_sku.name, "HS") ? [] : ["enabled"]
82+
for_each = var.elastic_pool_enabled && try(startswith(local.elastic_pool_sku.name, "HS"), false) ? [] : ["enabled"]
8383
content {
8484
retention_days = var.point_in_time_restore_retention_days
8585
# backup_interval_in_hours is only supported for elastic pool databases

r-sql.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ resource "azurerm_mssql_server" "main" {
2222
}
2323
}
2424

25+
primary_user_assigned_identity_id = var.primary_user_assigned_identity_id
26+
2527
dynamic "identity" {
2628
for_each = var.identity[*]
2729
content {

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,9 @@ variable "identity" {
331331
default = {}
332332
nullable = false
333333
}
334+
335+
variable "primary_user_assigned_identity_id" {
336+
description = "Specifies the primary user managed identity id. Required if type within the identity block is set to either SystemAssigned, UserAssigned or UserAssigned and should be set at same time as setting identity_ids."
337+
type = string
338+
default = null
339+
}

0 commit comments

Comments
 (0)