│ Error: 'creation_source_database_id' is required for create_mode Secondary
Expected Behaviour
The terraform should take the value "/subscriptions/...." of the key creation_source_database_id
Since create_mode = "c" then the variable in the module doesn't provide the right value.
Community Note
Terraform Version
1.4.6
AzureRM Provider Version
3.55.0
Affected Resource(s)/Data Source(s)
azurerm_mssql_server
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
The terraform should take the value "/subscriptions/...." of the key creation_source_database_id Since create_mode = "c" then the variable in the module doesn't provide the right value.
creation_source_database_id = can(regex("Copy|Secondary|PointInTimeRestore|Recovery|RestoreExternalBackup|Restore|RestoreExternalBackupSecondary", each.value.create_mode)) ? each.value.creation_source_database_id : null
It should be instead this
creation_source_database_id = can(regex("Copy|Secondary|PointInTimeRestore|Recovery|RestoreExternalBackup|Restore|RestoreExternalBackupSecondary", lookup(local.standard_allowed_create_mode, each.value.create_mode))) ? each.value.creation_source_database_id : null
I think it needs to be in this variable as well max_size_gb because it has the same logic I have succeeded to deploy this and it worked..
Actual Behaviour
No response
Steps to Reproduce
No response
Important Factoids
No response
References
No response