Skip to content

Commit

Permalink
feat: KeyVault - Updated UDTs to pending specs (#4111)
Browse files Browse the repository at this point in the history
## Description

Updated user-defined types with pending
Azure/Azure-Verified-Modules#1738 &
#4098.

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |

[![avm.res.key-vault.vault](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml/badge.svg?branch=users%2Falsehr%2FkeyVault_udt&event=workflow_dispatch)](https://github.com/AlexanderSehr/bicep-registry-modules/actions/workflows/avm.res.key-vault.vault.yml)

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [x] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation
  • Loading branch information
AlexanderSehr authored Jan 15, 2025
1 parent 65a30ac commit b985d5f
Show file tree
Hide file tree
Showing 16 changed files with 370 additions and 371 deletions.
30 changes: 5 additions & 25 deletions avm/res/key-vault/vault/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This module deploys a Key Vault.
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
| `Microsoft.KeyVault/vaults` | [2022-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2022-07-01/vaults) |
| `Microsoft.KeyVault/vaults/accessPolicies` | [2022-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2022-07-01/vaults/accessPolicies) |
| `Microsoft.KeyVault/vaults/accessPolicies` | [2023-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2023-07-01/vaults/accessPolicies) |
| `Microsoft.KeyVault/vaults/keys` | [2022-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2022-07-01/vaults/keys) |
| `Microsoft.KeyVault/vaults/secrets` | [2022-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2022-07-01/vaults/secrets) |
| `Microsoft.Network/privateEndpoints` | [2023-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2023-11-01/privateEndpoints) |
Expand Down Expand Up @@ -56,7 +56,6 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
name: 'kvvmin002'
// Non-required parameters
enablePurgeProtection: false
location: '<location>'
}
}
```
Expand All @@ -80,9 +79,6 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
// Non-required parameters
"enablePurgeProtection": {
"value": false
},
"location": {
"value": "<location>"
}
}
}
Expand All @@ -102,7 +98,6 @@ using 'br/public:avm/res/key-vault/vault:<version>'
param name = 'kvvmin002'
// Non-required parameters
param enablePurgeProtection = false
param location = '<location>'
```

</details>
Expand Down Expand Up @@ -159,7 +154,6 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
}
}
]
location: '<location>'
}
}
```
Expand Down Expand Up @@ -219,9 +213,6 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
}
}
]
},
"location": {
"value": "<location>"
}
}
}
Expand Down Expand Up @@ -275,7 +266,6 @@ param keys = [
}
}
]
param location = '<location>'
```

</details>
Expand Down Expand Up @@ -1111,7 +1101,6 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
}
}
]
location: '<location>'
}
}
```
Expand Down Expand Up @@ -1171,9 +1160,6 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
}
}
]
},
"location": {
"value": "<location>"
}
}
}
Expand Down Expand Up @@ -1227,7 +1213,6 @@ param keys = [
}
}
]
param location = '<location>'
```

</details>
Expand Down Expand Up @@ -1293,7 +1278,6 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
}
}
]
location: '<location>'
networkAcls: {
bypass: 'AzureServices'
defaultAction: 'Deny'
Expand Down Expand Up @@ -1400,9 +1384,6 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
}
]
},
"location": {
"value": "<location>"
},
"networkAcls": {
"value": {
"bypass": "AzureServices",
Expand Down Expand Up @@ -1509,7 +1490,6 @@ param keys = [
}
}
]
param location = '<location>'
param networkAcls = {
bypass: 'AzureServices'
defaultAction: 'Deny'
Expand Down Expand Up @@ -2433,7 +2413,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`name`](#parameter-privateendpointsname) | string | The name of the Private Endpoint. |
| [`privateDnsZoneGroup`](#parameter-privateendpointsprivatednszonegroup) | object | The private DNS Zone Group to configure for the Private Endpoint. |
| [`privateLinkServiceConnectionName`](#parameter-privateendpointsprivatelinkserviceconnectionname) | string | The name of the private link connection to create. |
| [`resourceGroupName`](#parameter-privateendpointsresourcegroupname) | string | Specify if you want to deploy the Private Endpoint into a different Resource Group than the main resource. |
| [`resourceGroupResourceId`](#parameter-privateendpointsresourcegroupresourceid) | string | The resource ID of the Resource Group the Private Endpoint will be created in. If not specified, the Resource Group of the provided Virtual Network Subnet is used. |
| [`roleAssignments`](#parameter-privateendpointsroleassignments) | array | Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | string | The subresource to deploy the Private Endpoint for. For example "vault" for a Key Vault Private Endpoint. |
| [`tags`](#parameter-privateendpointstags) | object | Tags to be applied on all resources/Resource Groups in this deployment. |
Expand Down Expand Up @@ -2686,9 +2666,9 @@ The name of the private link connection to create.
- Required: No
- Type: string

### Parameter: `privateEndpoints.resourceGroupName`
### Parameter: `privateEndpoints.resourceGroupResourceId`

Specify if you want to deploy the Private Endpoint into a different Resource Group than the main resource.
The resource ID of the Resource Group the Private Endpoint will be created in. If not specified, the Resource Group of the provided Virtual Network Subnet is used.

- Required: No
- Type: string
Expand Down Expand Up @@ -3189,7 +3169,7 @@ This section gives you an overview of all local-referenced module files (i.e., o
| Reference | Type |
| :-- | :-- |
| `br/public:avm/res/network/private-endpoint:0.9.0` | Remote reference |
| `br/public:avm/utl/types/avm-common-types:0.2.1` | Remote reference |
| `br/public:avm/utl/types/avm-common-types:0.5.1` | Remote reference |

## Data Collection

Expand Down
2 changes: 1 addition & 1 deletion avm/res/key-vault/vault/access-policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This module deploys a Key Vault Access Policy.

| Resource Type | API Version |
| :-- | :-- |
| `Microsoft.KeyVault/vaults/accessPolicies` | [2022-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2022-07-01/vaults/accessPolicies) |
| `Microsoft.KeyVault/vaults/accessPolicies` | [2023-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.KeyVault/2023-07-01/vaults/accessPolicies) |

## Parameters

Expand Down
26 changes: 13 additions & 13 deletions avm/res/key-vault/vault/access-policy/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,24 @@ metadata owner = 'Azure/module-maintainers'
param keyVaultName string

@description('Optional. An array of 0 to 16 identities that have access to the key vault. All identities in the array must use the same tenant ID as the key vault\'s tenant ID.')
param accessPolicies accessPoliciesType

var formattedAccessPolicies = [
for accessPolicy in (accessPolicies ?? []): {
applicationId: accessPolicy.?applicationId ?? ''
objectId: accessPolicy.objectId
permissions: accessPolicy.permissions
tenantId: accessPolicy.?tenantId ?? tenant().tenantId
}
]
param accessPolicies accessPoliciesType[]?

resource keyVault 'Microsoft.KeyVault/vaults@2022-07-01' existing = {
name: keyVaultName
}

resource policies 'Microsoft.KeyVault/vaults/accessPolicies@2022-07-01' = {
resource policies 'Microsoft.KeyVault/vaults/accessPolicies@2023-07-01' = {
name: 'add'
parent: keyVault
properties: {
accessPolicies: formattedAccessPolicies
accessPolicies: [
for accessPolicy in (accessPolicies ?? []): {
applicationId: accessPolicy.?applicationId ?? ''
objectId: accessPolicy.objectId
permissions: accessPolicy.permissions
tenantId: accessPolicy.?tenantId ?? tenant().tenantId
}
]
}
}

Expand All @@ -41,6 +39,8 @@ output resourceId string = policies.id
// ================ //
// Definitions //
// ================ //
@export()
@description('The type for an access policy.')
type accessPoliciesType = {
@description('Optional. The tenant ID that is used for authenticating requests to the key vault.')
tenantId: string?
Expand Down Expand Up @@ -118,4 +118,4 @@ type accessPoliciesType = {
| 'setsas'
| 'update')[]?
}
}[]?
}
Loading

0 comments on commit b985d5f

Please sign in to comment.