Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated key vault + fixed few issues
Browse files Browse the repository at this point in the history
AlexanderSehr committed Oct 3, 2024
1 parent 0b67c15 commit d0ce9fa
Showing 13 changed files with 1,134 additions and 1,283 deletions.
68 changes: 38 additions & 30 deletions avm/res/key-vault/vault/README.md
Original file line number Diff line number Diff line change
@@ -284,8 +284,10 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
enableRbacAuthorization: false
keys: [
{
attributesExp: 1725109032
attributesNbf: 10000
attributes: {
exp: 1725109032
nbf: 10000
}
name: 'keyName'
roleAssignments: [
{
@@ -427,8 +429,10 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
]
secrets: [
{
attributesExp: 1702648632
attributesNbf: 10000
attributes: {
exp: 1725109032
nbf: 10000
}
contentType: 'Something'
name: 'secretName'
roleAssignments: [
@@ -540,8 +544,10 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
"keys": {
"value": [
{
"attributesExp": 1725109032,
"attributesNbf": 10000,
"attributes": {
"exp": 1725109032,
"nbf": 10000
},
"name": "keyName",
"roleAssignments": [
{
@@ -695,8 +701,10 @@ module vault 'br/public:avm/res/key-vault/vault:<version>' = {
"secrets": {
"value": [
{
"attributesExp": 1702648632,
"attributesNbf": 10000,
"attributes": {
"exp": 1725109032,
"nbf": 10000
},
"contentType": "Something",
"name": "secretName",
"roleAssignments": [
@@ -1962,22 +1970,22 @@ Configuration details for private endpoints. For security reasons, it is recomme

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`applicationSecurityGroupResourceIds`](#parameter-privateendpointsapplicationsecuritygroupresourceids) | array | Application security groups in which the private endpoint IP configuration is included. |
| [`applicationSecurityGroupResourceIds`](#parameter-privateendpointsapplicationsecuritygroupresourceids) | array | Application security groups in which the Private Endpoint IP configuration is included. |
| [`customDnsConfigs`](#parameter-privateendpointscustomdnsconfigs) | array | Custom DNS configurations. |
| [`customNetworkInterfaceName`](#parameter-privateendpointscustomnetworkinterfacename) | string | The custom name of the network interface attached to the private endpoint. |
| [`customNetworkInterfaceName`](#parameter-privateendpointscustomnetworkinterfacename) | string | The custom name of the network interface attached to the Private Endpoint. |
| [`enableTelemetry`](#parameter-privateendpointsenabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`ipConfigurations`](#parameter-privateendpointsipconfigurations) | array | A list of IP configurations of the private endpoint. This will be used to map to the First Party Service endpoints. |
| [`ipConfigurations`](#parameter-privateendpointsipconfigurations) | array | A list of IP configurations of the Private Endpoint. This will be used to map to the first-party Service endpoints. |
| [`isManualConnection`](#parameter-privateendpointsismanualconnection) | bool | If Manual Private Link Connection is required. |
| [`location`](#parameter-privateendpointslocation) | string | The location to deploy the private endpoint to. |
| [`location`](#parameter-privateendpointslocation) | string | The location to deploy the Private Endpoint to. |
| [`lock`](#parameter-privateendpointslock) | object | Specify the type of lock. |
| [`manualConnectionRequestMessage`](#parameter-privateendpointsmanualconnectionrequestmessage) | string | A message passed to the owner of the remote resource with the manual connection request. |
| [`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. |
| [`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. |
| [`resourceGroupName`](#parameter-privateendpointsresourcegroupname) | string | Specify if you want to deploy the Private Endpoint into a different Resource Group than the main resource. |
| [`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", "mysqlServer" or "dataFactory". |
| [`tags`](#parameter-privateendpointstags) | object | Tags to be applied on all resources/resource groups in this deployment. |
| [`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. |

### Parameter: `privateEndpoints.subnetResourceId`

@@ -1988,7 +1996,7 @@ Resource ID of the subnet where the endpoint needs to be created.

### Parameter: `privateEndpoints.applicationSecurityGroupResourceIds`

Application security groups in which the private endpoint IP configuration is included.
Application security groups in which the Private Endpoint IP configuration is included.

- Required: No
- Type: array
@@ -2023,7 +2031,7 @@ A list of private IP addresses of the private endpoint.

### Parameter: `privateEndpoints.customNetworkInterfaceName`

The custom name of the network interface attached to the private endpoint.
The custom name of the network interface attached to the Private Endpoint.

- Required: No
- Type: string
@@ -2037,7 +2045,7 @@ Enable/Disable usage telemetry for module.

### Parameter: `privateEndpoints.ipConfigurations`

A list of IP configurations of the private endpoint. This will be used to map to the First Party Service endpoints.
A list of IP configurations of the Private Endpoint. This will be used to map to the first-party Service endpoints.

- Required: No
- Type: array
@@ -2101,7 +2109,7 @@ If Manual Private Link Connection is required.

### Parameter: `privateEndpoints.location`

The location to deploy the private endpoint to.
The location to deploy the Private Endpoint to.

- Required: No
- Type: string
@@ -2151,14 +2159,14 @@ A message passed to the owner of the remote resource with the manual connection

### Parameter: `privateEndpoints.name`

The name of the private endpoint.
The name of the Private Endpoint.

- Required: No
- Type: string

### Parameter: `privateEndpoints.privateDnsZoneGroup`

The private DNS zone group to configure for the private endpoint.
The private DNS Zone Group to configure for the Private Endpoint.

- Required: No
- Type: object
@@ -2167,7 +2175,7 @@ The private DNS zone group to configure for the private endpoint.

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`privateDnsZoneGroupConfigs`](#parameter-privateendpointsprivatednszonegroupprivatednszonegroupconfigs) | array | The private DNS zone groups to associate the private endpoint. A DNS zone group can support up to 5 DNS zones. |
| [`privateDnsZoneGroupConfigs`](#parameter-privateendpointsprivatednszonegroupprivatednszonegroupconfigs) | array | The private DNS Zone Groups to associate the Private Endpoint. A DNS Zone Group can support up to 5 DNS zones. |

**Optional parameters**

@@ -2177,7 +2185,7 @@ The private DNS zone group to configure for the private endpoint.

### Parameter: `privateEndpoints.privateDnsZoneGroup.privateDnsZoneGroupConfigs`

The private DNS zone groups to associate the private endpoint. A DNS zone group can support up to 5 DNS zones.
The private DNS Zone Groups to associate the Private Endpoint. A DNS Zone Group can support up to 5 DNS zones.

- Required: Yes
- Type: array
@@ -2192,7 +2200,7 @@ The private DNS zone groups to associate the private endpoint. A DNS zone group

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`name`](#parameter-privateendpointsprivatednszonegroupprivatednszonegroupconfigsname) | string | The name of the private DNS zone group config. |
| [`name`](#parameter-privateendpointsprivatednszonegroupprivatednszonegroupconfigsname) | string | The name of the private DNS Zone Group config. |

### Parameter: `privateEndpoints.privateDnsZoneGroup.privateDnsZoneGroupConfigs.privateDnsZoneResourceId`

@@ -2203,7 +2211,7 @@ The resource id of the private DNS zone.

### Parameter: `privateEndpoints.privateDnsZoneGroup.privateDnsZoneGroupConfigs.name`

The name of the private DNS zone group config.
The name of the private DNS Zone Group config.

- Required: No
- Type: string
@@ -2224,7 +2232,7 @@ The name of the private link connection to create.

### Parameter: `privateEndpoints.resourceGroupName`

Specify if you want to deploy the Private Endpoint into a different resource group than the main resource.
Specify if you want to deploy the Private Endpoint into a different Resource Group than the main resource.

- Required: No
- Type: string
@@ -2339,14 +2347,14 @@ The principal type of the assigned principal ID.

### Parameter: `privateEndpoints.service`

The subresource to deploy the private endpoint for. For example "vault", "mysqlServer" or "dataFactory".
The subresource to deploy the Private Endpoint for. For example "vault" for a Key Vault Private Endpoint.

- Required: No
- Type: string

### Parameter: `privateEndpoints.tags`

Tags to be applied on all resources/resource groups in this deployment.
Tags to be applied on all resources/Resource Groups in this deployment.

- Required: No
- Type: object
4 changes: 2 additions & 2 deletions avm/res/key-vault/vault/access-policy/main.json
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "7494731697751039419"
"version": "0.30.23.60470",
"templateHash": "15469258025112973480"
},
"name": "Key Vault Access Policies",
"description": "This module deploys a Key Vault Access Policy.",
28 changes: 2 additions & 26 deletions avm/res/key-vault/vault/key/main.bicep
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ param kty string = 'EC'
param releasePolicy object?

@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
param roleAssignments roleAssignmentType[]?

@description('Optional. Key rotation policy properties object.')
param rotationPolicy object?
@@ -163,28 +163,4 @@ output resourceGroupName string = resourceGroup().name
// Definitions //
// ================ //

type roleAssignmentType = {
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
name: string?

@description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string

@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
principalId: string

@description('Optional. The principal type of the assigned principal ID.')
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?

@description('Optional. The description of the role assignment.')
description: string?

@description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
condition: string?

@description('Optional. Version of the condition.')
conditionVersion: '2.0'?

@description('Optional. The Resource Id of the delegated managed identity resource.')
delegatedManagedIdentityResourceId: string?
}[]?
import { roleAssignmentType } from '../../../../utl/types/avm-common-type/main.bicep'
147 changes: 76 additions & 71 deletions avm/res/key-vault/vault/key/main.json
Original file line number Diff line number Diff line change
@@ -5,86 +5,87 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "14269695922191217406"
"version": "0.30.23.60470",
"templateHash": "15780338747744224269"
},
"name": "Key Vault Keys",
"description": "This module deploys a Key Vault Key.",
"owner": "Azure/module-maintainers"
},
"definitions": {
"roleAssignmentType": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated."
}
},
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
"description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
"type": "string",
"metadata": {
"description": "Required. The principal ID of the principal (user/group/identity) to assign the role to."
}
},
"principalType": {
"type": "string",
"allowedValues": [
"Device",
"ForeignGroup",
"Group",
"ServicePrincipal",
"User"
],
"nullable": true,
"metadata": {
"description": "Optional. The principal type of the assigned principal ID."
}
},
"description": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The description of the role assignment."
}
},
"condition": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"."
}
},
"conditionVersion": {
"type": "string",
"allowedValues": [
"2.0"
],
"nullable": true,
"metadata": {
"description": "Optional. Version of the condition."
}
},
"delegatedManagedIdentityResourceId": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The Resource Id of the delegated managed identity resource."
}
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated."
}
},
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
"description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
"type": "string",
"metadata": {
"description": "Required. The principal ID of the principal (user/group/identity) to assign the role to."
}
},
"principalType": {
"type": "string",
"allowedValues": [
"Device",
"ForeignGroup",
"Group",
"ServicePrincipal",
"User"
],
"nullable": true,
"metadata": {
"description": "Optional. The principal type of the assigned principal ID."
}
},
"description": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The description of the role assignment."
}
},
"condition": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"."
}
},
"conditionVersion": {
"type": "string",
"allowedValues": [
"2.0"
],
"nullable": true,
"metadata": {
"description": "Optional. Version of the condition."
}
},
"delegatedManagedIdentityResourceId": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The Resource Id of the delegated managed identity resource."
}
}
},
"nullable": true
"metadata": {
"__bicep_imported_from!": {
"sourceTemplate": "../../../../utl/types/avm-common-type/main.bicep"
}
}
}
},
"parameters": {
@@ -185,7 +186,11 @@
}
},
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"type": "array",
"items": {
"$ref": "#/definitions/roleAssignmentType"
},
"nullable": true,
"metadata": {
"description": "Optional. Array of role assignments to create."
}
177 changes: 7 additions & 170 deletions avm/res/key-vault/vault/main.bicep
Original file line number Diff line number Diff line change
@@ -64,19 +64,19 @@ param networkAcls object?
param publicNetworkAccess string = ''

@description('Optional. The lock settings of the service.')
param lock lockType
param lock lockType?

@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
param roleAssignments (roleAssignmentType)[]?

@description('Optional. Configuration details for private endpoints. For security reasons, it is recommended to use private endpoints whenever possible.')
param privateEndpoints privateEndpointType
param privateEndpoints (privateEndpointSingleServiceType)[]?

@description('Optional. Resource tags.')
param tags object?

@description('Optional. The diagnostic settings of the service.')
param diagnosticSettings diagnosticSettingType
param diagnosticSettings diagnosticSettingFullType[]?

@description('Optional. Enable/Disable usage telemetry for module.')
param enableTelemetry bool = true
@@ -402,170 +402,7 @@ output privateEndpoints array = [
// Definitions //
// ================ //

type diagnosticSettingType = {
@description('Optional. The name of diagnostic setting.')
name: string?

@description('Optional. The name of logs that will be streamed. "allLogs" includes all possible logs for the resource. Set to `[]` to disable log collection.')
logCategoriesAndGroups: {
@description('Optional. Name of a Diagnostic Log category for a resource type this setting is applied to. Set the specific logs to collect here.')
category: string?

@description('Optional. Name of a Diagnostic Log category group for a resource type this setting is applied to. Set to `allLogs` to collect all logs.')
categoryGroup: string?

@description('Optional. Enable or disable the category explicitly. Default is `true`.')
enabled: bool?
}[]?

@description('Optional. The name of metrics that will be streamed. "allMetrics" includes all possible metrics for the resource. Set to `[]` to disable metric collection.')
metricCategories: {
@description('Required. Name of a Diagnostic Metric category for a resource type this setting is applied to. Set to `AllMetrics` to collect all metrics.')
category: string

@description('Optional. Enable or disable the category explicitly. Default is `true`.')
enabled: bool?
}[]?

@description('Optional. A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type.')
logAnalyticsDestinationType: ('Dedicated' | 'AzureDiagnostics')?

@description('Optional. Resource ID of the diagnostic log analytics workspace. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
workspaceResourceId: string?

@description('Optional. Resource ID of the diagnostic storage account. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
storageAccountResourceId: string?

@description('Optional. Resource ID of the diagnostic event hub authorization rule for the Event Hubs namespace in which the event hub should be created or streamed to.')
eventHubAuthorizationRuleResourceId: string?

@description('Optional. Name of the diagnostic event hub within the namespace to which logs are streamed. Without this, an event hub is created for each log category. For security reasons, it is recommended to set diagnostic settings to send data to either storage account, log analytics workspace or event hub.')
eventHubName: string?

@description('Optional. The full ARM resource ID of the Marketplace resource to which you would like to send Diagnostic Logs.')
marketplacePartnerResourceId: string?
}[]?

type roleAssignmentType = {
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
name: string?

@description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string

@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
principalId: string

@description('Optional. The principal type of the assigned principal ID.')
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?

@description('Optional. The description of the role assignment.')
description: string?

@description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
condition: string?

@description('Optional. Version of the condition.')
conditionVersion: '2.0'?

@description('Optional. The Resource Id of the delegated managed identity resource.')
delegatedManagedIdentityResourceId: string?
}[]?

type privateEndpointType = {
@description('Optional. The name of the private endpoint.')
name: string?

@description('Optional. The location to deploy the private endpoint to.')
location: string?

@description('Optional. The name of the private link connection to create.')
privateLinkServiceConnectionName: string?

@description('Optional. The subresource to deploy the private endpoint for. For example "vault", "mysqlServer" or "dataFactory".')
service: string?

@description('Required. Resource ID of the subnet where the endpoint needs to be created.')
subnetResourceId: string

@description('Optional. The private DNS zone group to configure for the private endpoint.')
privateDnsZoneGroup: {
@description('Optional. The name of the Private DNS Zone Group.')
name: string?

@description('Required. The private DNS zone groups to associate the private endpoint. A DNS zone group can support up to 5 DNS zones.')
privateDnsZoneGroupConfigs: {
@description('Optional. The name of the private DNS zone group config.')
name: string?

@description('Required. The resource id of the private DNS zone.')
privateDnsZoneResourceId: string
}[]
}?

@description('Optional. If Manual Private Link Connection is required.')
isManualConnection: bool?

@description('Optional. A message passed to the owner of the remote resource with the manual connection request.')
@maxLength(140)
manualConnectionRequestMessage: string?

@description('Optional. Custom DNS configurations.')
customDnsConfigs: {
@description('Required. Fqdn that resolves to private endpoint IP address.')
fqdn: string?

@description('Required. A list of private IP addresses of the private endpoint.')
ipAddresses: string[]
}[]?

@description('Optional. A list of IP configurations of the private endpoint. This will be used to map to the First Party Service endpoints.')
ipConfigurations: {
@description('Required. The name of the resource that is unique within a resource group.')
name: string

@description('Required. Properties of private endpoint IP configurations.')
properties: {
@description('Required. The ID of a group obtained from the remote resource that this private endpoint should connect to.')
groupId: string

@description('Required. The member name of a group obtained from the remote resource that this private endpoint should connect to.')
memberName: string

@description('Required. A private IP address obtained from the private endpoint\'s subnet.')
privateIPAddress: string
}
}[]?

@description('Optional. Application security groups in which the private endpoint IP configuration is included.')
applicationSecurityGroupResourceIds: string[]?

@description('Optional. The custom name of the network interface attached to the private endpoint.')
customNetworkInterfaceName: string?

@description('Optional. Specify the type of lock.')
lock: lockType

@description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType

@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
tags: object?

@description('Optional. Enable/Disable usage telemetry for module.')
enableTelemetry: bool?

@description('Optional. Specify if you want to deploy the Private Endpoint into a different resource group than the main resource.')
resourceGroupName: string?
}[]?

type lockType = {
@description('Optional. Specify the name of lock.')
name: string?

@description('Optional. Specify the type of lock.')
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
}?
import { roleAssignmentType, privateEndpointSingleServiceType, diagnosticSettingFullType, lockType } from '../../../utl/types/avm-common-type/main.bicep'

type accessPoliciesType = {
@description('Optional. The tenant ID that is used for authenticating requests to the key vault.')
@@ -672,7 +509,7 @@ type secretsType = {
value: string

@description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType?
roleAssignments: roleAssignmentType[]?
}[]?

type keysType = {
@@ -718,7 +555,7 @@ type keysType = {
rotationPolicy: rotationPoliciesType?

@description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType?
roleAssignments: roleAssignmentType[]?
}[]?

type rotationPoliciesType = {
1,715 changes: 890 additions & 825 deletions avm/res/key-vault/vault/main.json

Large diffs are not rendered by default.

28 changes: 2 additions & 26 deletions avm/res/key-vault/vault/secret/main.bicep
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ param contentType string?
param value string

@description('Optional. Array of role assignments to create.')
param roleAssignments roleAssignmentType
param roleAssignments roleAssignmentType[]?

var builtInRoleNames = {
Contributor: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', 'b24988ac-6180-42a0-ab88-20f7382dd24c')
@@ -124,28 +124,4 @@ output resourceGroupName string = resourceGroup().name
// Definitions //
// ================ //

type roleAssignmentType = {
@description('Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated.')
name: string?

@description('Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: \'/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11\'.')
roleDefinitionIdOrName: string

@description('Required. The principal ID of the principal (user/group/identity) to assign the role to.')
principalId: string

@description('Optional. The principal type of the assigned principal ID.')
principalType: ('ServicePrincipal' | 'Group' | 'User' | 'ForeignGroup' | 'Device')?

@description('Optional. The description of the role assignment.')
description: string?

@description('Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".')
condition: string?

@description('Optional. Version of the condition.')
conditionVersion: '2.0'?

@description('Optional. The Resource Id of the delegated managed identity resource.')
delegatedManagedIdentityResourceId: string?
}[]?
import { roleAssignmentType } from '../../../../utl/types/avm-common-type/main.bicep'
147 changes: 76 additions & 71 deletions avm/res/key-vault/vault/secret/main.json
Original file line number Diff line number Diff line change
@@ -5,86 +5,87 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "114626909766354577"
"version": "0.30.23.60470",
"templateHash": "18331806950822487863"
},
"name": "Key Vault Secrets",
"description": "This module deploys a Key Vault Secret.",
"owner": "Azure/module-maintainers"
},
"definitions": {
"roleAssignmentType": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated."
}
},
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
"description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
"type": "string",
"metadata": {
"description": "Required. The principal ID of the principal (user/group/identity) to assign the role to."
}
},
"principalType": {
"type": "string",
"allowedValues": [
"Device",
"ForeignGroup",
"Group",
"ServicePrincipal",
"User"
],
"nullable": true,
"metadata": {
"description": "Optional. The principal type of the assigned principal ID."
}
},
"description": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The description of the role assignment."
}
},
"condition": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"."
}
},
"conditionVersion": {
"type": "string",
"allowedValues": [
"2.0"
],
"nullable": true,
"metadata": {
"description": "Optional. Version of the condition."
}
},
"delegatedManagedIdentityResourceId": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The Resource Id of the delegated managed identity resource."
}
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The name (as GUID) of the role assignment. If not provided, a GUID will be generated."
}
},
"roleDefinitionIdOrName": {
"type": "string",
"metadata": {
"description": "Required. The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'."
}
},
"principalId": {
"type": "string",
"metadata": {
"description": "Required. The principal ID of the principal (user/group/identity) to assign the role to."
}
},
"principalType": {
"type": "string",
"allowedValues": [
"Device",
"ForeignGroup",
"Group",
"ServicePrincipal",
"User"
],
"nullable": true,
"metadata": {
"description": "Optional. The principal type of the assigned principal ID."
}
},
"description": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The description of the role assignment."
}
},
"condition": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase \"foo_storage_container\"."
}
},
"conditionVersion": {
"type": "string",
"allowedValues": [
"2.0"
],
"nullable": true,
"metadata": {
"description": "Optional. Version of the condition."
}
},
"delegatedManagedIdentityResourceId": {
"type": "string",
"nullable": true,
"metadata": {
"description": "Optional. The Resource Id of the delegated managed identity resource."
}
}
},
"nullable": true
"metadata": {
"__bicep_imported_from!": {
"sourceTemplate": "../../../../utl/types/avm-common-type/main.bicep"
}
}
}
},
"parameters": {
@@ -142,7 +143,11 @@
}
},
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"type": "array",
"items": {
"$ref": "#/definitions/roleAssignmentType"
},
"nullable": true,
"metadata": {
"description": "Optional. Array of role assignments to create."
}
12 changes: 8 additions & 4 deletions avm/res/key-vault/vault/tests/e2e/max/main.test.bicep
Original file line number Diff line number Diff line change
@@ -123,8 +123,10 @@ module testDeployment '../../../main.bicep' = [
enableRbacAuthorization: false
keys: [
{
attributesExp: 1725109032
attributesNbf: 10000
attributes: {
exp: 1725109032
nbf: 10000
}
name: 'keyName'
roleAssignments: [
{
@@ -274,8 +276,10 @@ module testDeployment '../../../main.bicep' = [
]
secrets: [
{
attributesExp: 1702648632
attributesNbf: 10000
attributes: {
exp: 1725109032
nbf: 10000
}
contentType: 'Something'
name: 'secretName'
roleAssignments: [
24 changes: 9 additions & 15 deletions avm/utl/types/avm-common-type/README.md
Original file line number Diff line number Diff line change
@@ -157,14 +157,6 @@ output locks types.lockType = {
name: 'myLock'
}
// ======== //
// Tags //
// ======== //
output tags types.tagsType = {
tagA: 'tagValueA'
tagB: 'tagValueB'
}
// ====================== //
// Managed Idenitites //
// ====================== //
@@ -191,13 +183,15 @@ output privateEndpointMultiService types.privateEndpointMultiServiceType = {
kind: 'CanNotDelete'
name: 'myLock'
}
roleAssignments: {
principalId: '11111111-1111-1111-1111-111111111111'
roleDefinitionIdOrName: subscriptionResourceId(
'Microsoft.Authorization/roleDefinitions',
'acdd72a7-3385-48ef-bd42-f606fba81ae7'
) // Reader
}
roleAssignments: [
{
principalId: '11111111-1111-1111-1111-111111111111'
roleDefinitionIdOrName: subscriptionResourceId(
'Microsoft.Authorization/roleDefinitions',
'acdd72a7-3385-48ef-bd42-f606fba81ae7'
) // Reader
}
]
subnetResourceId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/defaultSubnet'
service: 'blob'
applicationSecurityGroupResourceIds: [
17 changes: 4 additions & 13 deletions avm/utl/types/avm-common-type/main.bicep
Original file line number Diff line number Diff line change
@@ -170,15 +170,6 @@ type lockType = {
kind: ('CanNotDelete' | 'ReadOnly' | 'None')?
}

// ======== //
// Tags //
// ======== //

@export()
type tagsType = {
*: string
}

// ====================== //
// Managed Idenitites //
// ====================== //
@@ -294,10 +285,10 @@ type privateEndpointSingleServiceType = {
lock: lockType?

@description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType?
roleAssignments: roleAssignmentType[]?

@description('Optional. Tags to be applied on all resources/Resource Groups in this deployment.')
tags: tagsType?
tags: object?

@description('Optional. Enable/Disable usage telemetry for module.')
enableTelemetry: bool?
@@ -350,10 +341,10 @@ type privateEndpointMultiServiceType = {
lock: lockType?

@description('Optional. Array of role assignments to create.')
roleAssignments: roleAssignmentType?
roleAssignments: roleAssignmentType[]?

@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
tags: tagsType?
tags: object?

@description('Optional. Enable/Disable usage telemetry for module.')
enableTelemetry: bool?
26 changes: 11 additions & 15 deletions avm/utl/types/avm-common-type/main.json
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.30.23.60470",
"templateHash": "1255731738547382740"
"templateHash": "5266443159177431002"
},
"name": "Default interface types for AVM modules",
"description": "This module provides you with all common variants for AVM interfaces to be used in AVM modules.\n\nDetails for how to implement these interfaces can be found in the AVM documentation [here](https://azure.github.io/Azure-Verified-Modules/specs/bicep/interfaces).\n"
@@ -410,16 +410,6 @@
"__bicep_export!": true
}
},
"tagsType": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "string"
},
"metadata": {
"__bicep_export!": true
}
},
"managedIdentitiesAllType": {
"type": "object",
"properties": {
@@ -676,14 +666,17 @@
}
},
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"type": "array",
"items": {
"$ref": "#/definitions/roleAssignmentType"
},
"nullable": true,
"metadata": {
"description": "Optional. Array of role assignments to create."
}
},
"tags": {
"$ref": "#/definitions/tagsType",
"type": "object",
"nullable": true,
"metadata": {
"description": "Optional. Tags to be applied on all resources/Resource Groups in this deployment."
@@ -811,14 +804,17 @@
}
},
"roleAssignments": {
"$ref": "#/definitions/roleAssignmentType",
"type": "array",
"items": {
"$ref": "#/definitions/roleAssignmentType"
},
"nullable": true,
"metadata": {
"description": "Optional. Array of role assignments to create."
}
},
"tags": {
"$ref": "#/definitions/tagsType",
"type": "object",
"nullable": true,
"metadata": {
"description": "Optional. Tags to be applied on all resources/resource groups in this deployment."
24 changes: 9 additions & 15 deletions avm/utl/types/avm-common-type/tests/e2e/import/main.test.bicep
Original file line number Diff line number Diff line change
@@ -119,14 +119,6 @@ output locks types.lockType = {
name: 'myLock'
}

// ======== //
// Tags //
// ======== //
output tags types.tagsType = {
tagA: 'tagValueA'
tagB: 'tagValueB'
}

// ====================== //
// Managed Idenitites //
// ====================== //
@@ -153,13 +145,15 @@ output privateEndpointMultiService types.privateEndpointMultiServiceType = {
kind: 'CanNotDelete'
name: 'myLock'
}
roleAssignments: {
principalId: '11111111-1111-1111-1111-111111111111'
roleDefinitionIdOrName: subscriptionResourceId(
'Microsoft.Authorization/roleDefinitions',
'acdd72a7-3385-48ef-bd42-f606fba81ae7'
) // Reader
}
roleAssignments: [
{
principalId: '11111111-1111-1111-1111-111111111111'
roleDefinitionIdOrName: subscriptionResourceId(
'Microsoft.Authorization/roleDefinitions',
'acdd72a7-3385-48ef-bd42-f606fba81ae7'
) // Reader
}
]
subnetResourceId: '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/myVnet/subnets/defaultSubnet'
service: 'blob'
applicationSecurityGroupResourceIds: [

0 comments on commit d0ce9fa

Please sign in to comment.