From 99b1955428b1f68137105b2cb5568efae15f54fd Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 10 Sep 2024 17:42:47 +0200 Subject: [PATCH 1/2] feat: Add key uri outputs to keyvault key submodule --- avm/res/key-vault/vault/key/README.md | 2 ++ avm/res/key-vault/vault/key/main.bicep | 6 ++++++ avm/res/key-vault/vault/key/main.json | 14 ++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/avm/res/key-vault/vault/key/README.md b/avm/res/key-vault/vault/key/README.md index 4531fa3eab..5f4b5efb2f 100644 --- a/avm/res/key-vault/vault/key/README.md +++ b/avm/res/key-vault/vault/key/README.md @@ -263,6 +263,8 @@ Resource tags. | Output | Type | Description | | :-- | :-- | :-- | +| `keyUriWithVersion` | string | The uri with version of the key. | +| `keyUri` | string | The uri of the key. | | `name` | string | The name of the key. | | `resourceGroupName` | string | The name of the resource group the key was created in. | | `resourceId` | string | The resource ID of the key. | diff --git a/avm/res/key-vault/vault/key/main.bicep b/avm/res/key-vault/vault/key/main.bicep index 45e00bf511..fc88d5479f 100644 --- a/avm/res/key-vault/vault/key/main.bicep +++ b/avm/res/key-vault/vault/key/main.bicep @@ -150,6 +150,12 @@ resource key_roleAssignments 'Microsoft.Authorization/roleAssignments@2022-04-01 } ] +@description('The uri of the key.') +output keyUri string = key.properties.keyUri + +@description('The uri with version of the key.') +output keyUriWithVersion string = key.properties.keyUriWithVersion + @description('The name of the key.') output name string = key.name diff --git a/avm/res/key-vault/vault/key/main.json b/avm/res/key-vault/vault/key/main.json index 63c2159cb2..791621efda 100644 --- a/avm/res/key-vault/vault/key/main.json +++ b/avm/res/key-vault/vault/key/main.json @@ -273,6 +273,20 @@ } }, "outputs": { + "keyUri": { + "type": "string", + "metadata": { + "description": "The uri of the key." + }, + "value": "[reference(resourceId('Microsoft.KeyVault/vaults/keys', parameters('keyVaultName'), parameters('name')).properties.keyUri]" + }, + "keyUriWithVersion": { + "type": "string", + "metadata": { + "description": "The uri with version of the key." + }, + "value": "[reference(resourceId('Microsoft.KeyVault/vaults/keys', parameters('keyVaultName'), parameters('name')).properties.keyUriWithVersion]" + }, "name": { "type": "string", "metadata": { From 46d83b8cd900336166011e5db32ea3fe778c559d Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 11 Sep 2024 09:12:52 +0200 Subject: [PATCH 2/2] updated compiled file --- avm/res/key-vault/vault/key/main.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/avm/res/key-vault/vault/key/main.json b/avm/res/key-vault/vault/key/main.json index 791621efda..b1a2bf2646 100644 --- a/avm/res/key-vault/vault/key/main.json +++ b/avm/res/key-vault/vault/key/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.29.47.4906", - "templateHash": "14269695922191217406" + "templateHash": "11345639823061254967" }, "name": "Key Vault Keys", "description": "This module deploys a Key Vault Key.", @@ -278,14 +278,14 @@ "metadata": { "description": "The uri of the key." }, - "value": "[reference(resourceId('Microsoft.KeyVault/vaults/keys', parameters('keyVaultName'), parameters('name')).properties.keyUri]" + "value": "[reference('key').keyUri]" }, "keyUriWithVersion": { "type": "string", "metadata": { "description": "The uri with version of the key." }, - "value": "[reference(resourceId('Microsoft.KeyVault/vaults/keys', parameters('keyVaultName'), parameters('name')).properties.keyUriWithVersion]" + "value": "[reference('key').keyUriWithVersion]" }, "name": { "type": "string",