Skip to content

Commit 456a471

Browse files
committed
update validate func to disallow versionless IDs
1 parent 66d9ec4 commit 456a471

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

internal/services/postgres/postgresql_flexible_server_resource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func resourcePostgresqlFlexibleServer() *pluginsdk.Resource {
319319
"key_vault_key_id": {
320320
Type: pluginsdk.TypeString,
321321
Required: true,
322-
ValidateFunc: keyVaultValidate.NestedItemIdWithOptionalVersion,
322+
ValidateFunc: keyVaultValidate.NestedItemId,
323323
RequiredWith: []string{
324324
"identity",
325325
"customer_managed_key.0.primary_user_assigned_identity_id",
@@ -333,7 +333,7 @@ func resourcePostgresqlFlexibleServer() *pluginsdk.Resource {
333333
"geo_backup_key_vault_key_id": {
334334
Type: pluginsdk.TypeString,
335335
Optional: true,
336-
ValidateFunc: keyVaultValidate.NestedItemIdWithOptionalVersion,
336+
ValidateFunc: keyVaultValidate.NestedItemId,
337337
RequiredWith: []string{
338338
"identity",
339339
"customer_managed_key.0.geo_backup_user_assigned_identity_id",

website/docs/r/postgresql_flexible_server.html.markdown

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ The following arguments are supported:
173173

174174
An `authentication` block supports the following:
175175

176-
* `active_directory_auth_enabled` - (Optional) Whether or not Active Directory authentication is allowed to access the PostgreSQL Flexible Server. Defaults to `false`.
176+
* `active_directory_auth_enabled` - (Optional) Whether Active Directory authentication is allowed to access the PostgreSQL Flexible Server. Defaults to `false`.
177177

178-
* `password_auth_enabled` - (Optional) Whether or not password authentication is allowed to access the PostgreSQL Flexible Server. Defaults to `true`.
178+
* `password_auth_enabled` - (Optional) Whether password authentication is allowed to access the PostgreSQL Flexible Server. Defaults to `true`.
179179

180180
* `tenant_id` - (Optional) The Tenant ID of the Azure Active Directory which is used by the Active Directory authentication. `active_directory_auth_enabled` must be set to `true`.
181181

@@ -187,13 +187,17 @@ An `authentication` block supports the following:
187187

188188
A `customer_managed_key` block supports the following:
189189

190-
* `key_vault_key_id` - (Required) The ID of the Key Vault Key.
190+
* `key_vault_key_id` - (Required) The versioned ID of the Key Vault Key.
191191

192-
* `primary_user_assigned_identity_id` - (Optional) Specifies the primary user managed identity id for a Customer Managed Key. Should be added with `identity_ids`.
192+
* `primary_user_assigned_identity_id` - (Optional) Specifies the primary user managed identity id for a Customer Managed Key. Must be added to `identity.identity_ids`.
193193

194-
* `geo_backup_key_vault_key_id` - (Optional) The ID of the geo backup Key Vault Key. It can't cross region and need Customer Managed Key in same region as geo backup.
194+
* `geo_backup_key_vault_key_id` - (Optional) The versioned ID of the geo backup Key Vault Key.
195195

196-
* `geo_backup_user_assigned_identity_id` - (Optional) The geo backup user managed identity id for a Customer Managed Key. Should be added with `identity_ids`. It can't cross region and need identity in same region as geo backup.
196+
~> **Note:** The key vault in which this key exists must be in the same region as the geo-redundant backup.
197+
198+
* `geo_backup_user_assigned_identity_id` - (Optional) The geo backup user managed identity id for a Customer Managed Key. Must be added to `identity.identity_ids`.
199+
200+
~> **Note:** This managed identity cannot be the same as `primary_user_assigned_identity_id`, additionally this identity must be created in the same region as the geo-redundant backup.
197201

198202
~> **Note:** `primary_user_assigned_identity_id` or `geo_backup_user_assigned_identity_id` is required when `type` is set to `UserAssigned`.
199203

@@ -215,7 +219,7 @@ A `maintenance_window` block supports the following:
215219

216220
* `start_minute` - (Optional) The start minute for maintenance window. Defaults to `0`.
217221

218-
-> **NOTE** The specified `maintenance_window` is always defined in UTC time. When unspecified, the maintenance window falls back to the default [system-managed](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-maintenance-portal#specify-maintenance-schedule-options).
222+
-> **Note:** The specified `maintenance_window` is always defined in UTC time. When unspecified, the maintenance window falls back to the default [system-managed](https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-maintenance-portal#specify-maintenance-schedule-options).
219223

220224
---
221225

0 commit comments

Comments
 (0)