Skip to content

Commit

Permalink
Merge branch 'Azure:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoldna authored Sep 3, 2024
2 parents 3dcb8f3 + d245a7f commit 38e79d0
Show file tree
Hide file tree
Showing 129 changed files with 6,717 additions and 3,282 deletions.
37 changes: 37 additions & 0 deletions .github/actions/templates/avm-validateModuleDeployment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ runs:
AdditionalParameters = @{}
}
# Add custom parameters as needed
if($moduleTemplatePossibleParameters -contains 'resourceLocation') {
$functionInput.AdditionalParameters += @{
resourceLocation = '${{ steps.get-resource-location.outputs.resourceLocation }}'
Expand All @@ -219,6 +220,24 @@ runs:
}
}
# Fetch & add custom secrets, if any
# -----------------------------------
$keyVaultName = "${{ env.CI_KEY_VAULT_NAME }}"
if(-not [String]::IsNullOrEmpty($keyVaultName)) {
# Note: This action requires at least 'Key Vault Secrets User' permissions
$customKeyVaultSecrets = Get-AzKeyVaultSecret -VaultName $keyVaultName | Where-Object { $_.Name -match '^CI-.+' }
foreach($customSecret in $customKeyVaultSecrets) {
$formattedName = $customSecret.Name -replace '^CI-' # e.g. 'CI-mySecret' -> 'mySecret'
if($moduleTemplatePossibleParameters -contains $formattedName) {
Write-Verbose ('Setting value for parameter [{0}]' -f $formattedName) -Verbose
$functionInput.AdditionalParameters += @{
$formattedName = (Get-AzKeyVaultSecret -VaultName $keyVaultName -Name $customSecret.Name).SecretValue
}
}
}
}
Write-Verbose 'Invoke task with' -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
Expand Down Expand Up @@ -280,6 +299,24 @@ runs:
}
}
# Fetch & add custom secrets, if any
# -----------------------------------
$keyVaultName = "${{ env.CI_KEY_VAULT_NAME }}"
if(-not [String]::IsNullOrEmpty($keyVaultName)) {
# Note: This action requires at least 'Key Vault Secrets User' permissions
$customKeyVaultSecrets = Get-AzKeyVaultSecret -VaultName $keyVaultName | Where-Object { $_.Name -match '^CI-.+' }
foreach($customSecret in $customKeyVaultSecrets) {
$formattedName = $customSecret.Name -replace '^CI-' # e.g. 'CI-mySecret' -> 'mySecret'
if($moduleTemplatePossibleParameters -contains $formattedName) {
Write-Verbose ('Setting value for parameter [{0}]' -f $formattedName) -Verbose
$functionInput.AdditionalParameters += @{
$formattedName = (Get-AzKeyVaultSecret -VaultName $keyVaultName -Name $customSecret.Name).SecretValue
}
}
}
}
Write-Verbose 'Invoke task with' -Verbose
Write-Verbose ($functionInput | ConvertTo-Json | Out-String) -Verbose
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/avm.template.module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ env:
ARM_MGMTGROUP_ID: "${{ secrets.ARM_MGMTGROUP_ID }}"
ARM_TENANT_ID: "${{ secrets.ARM_TENANT_ID }}"
TOKEN_NAMEPREFIX: "${{ secrets.TOKEN_NAMEPREFIX }}"
CI_KEY_VAULT_NAME: "${{ vars.CI_KEY_VAULT_NAME }}"

jobs:
#########################
Expand Down
101 changes: 81 additions & 20 deletions avm/res/app-configuration/configuration-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,13 @@ module configurationStore 'br/public:avm/res/app-configuration/configuration-sto
location: '<location>'
privateEndpoints: [
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
privateDnsZoneGroup: {
privateDnsZoneGroupConfigs: [
{
privateDnsZoneResourceId: '<privateDnsZoneResourceId>'
}
]
}
subnetResourceId: '<subnetResourceId>'
tags: {
Environment: 'Non-Prod'
Expand All @@ -480,9 +484,13 @@ module configurationStore 'br/public:avm/res/app-configuration/configuration-sto
}
}
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
privateDnsZoneGroup: {
privateDnsZoneGroupConfigs: [
{
privateDnsZoneResourceId: '<privateDnsZoneResourceId>'
}
]
}
subnetResourceId: '<subnetResourceId>'
}
]
Expand Down Expand Up @@ -520,9 +528,13 @@ module configurationStore 'br/public:avm/res/app-configuration/configuration-sto
"privateEndpoints": {
"value": [
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"privateDnsZoneGroup": {
"privateDnsZoneGroupConfigs": [
{
"privateDnsZoneResourceId": "<privateDnsZoneResourceId>"
}
]
},
"subnetResourceId": "<subnetResourceId>",
"tags": {
"Environment": "Non-Prod",
Expand All @@ -531,9 +543,13 @@ module configurationStore 'br/public:avm/res/app-configuration/configuration-sto
}
},
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"privateDnsZoneGroup": {
"privateDnsZoneGroupConfigs": [
{
"privateDnsZoneResourceId": "<privateDnsZoneResourceId>"
}
]
},
"subnetResourceId": "<subnetResourceId>"
}
]
Expand Down Expand Up @@ -1025,8 +1041,7 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`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. |
| [`privateDnsZoneGroupName`](#parameter-privateendpointsprivatednszonegroupname) | string | The name of the private DNS zone group to create if `privateDnsZoneResourceIds` were provided. |
| [`privateDnsZoneResourceIds`](#parameter-privateendpointsprivatednszoneresourceids) | array | The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones. |
| [`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. |
| [`roleAssignments`](#parameter-privateendpointsroleassignments) | array | Array of role assignments to create. |
Expand Down Expand Up @@ -1210,19 +1225,64 @@ The name of the private endpoint.
- Required: No
- Type: string

### Parameter: `privateEndpoints.privateDnsZoneGroupName`
### Parameter: `privateEndpoints.privateDnsZoneGroup`

The name of the private DNS zone group to create if `privateDnsZoneResourceIds` were provided.
The private DNS zone group to configure for the private endpoint.

- Required: No
- Type: object

**Required parameters**

| 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. |

**Optional parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`name`](#parameter-privateendpointsprivatednszonegroupname) | string | The name of the Private DNS Zone Group. |

### 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.

- Required: Yes
- Type: array

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`privateDnsZoneResourceId`](#parameter-privateendpointsprivatednszonegroupprivatednszonegroupconfigsprivatednszoneresourceid) | string | The resource id of the private DNS zone. |

**Optional parameters**

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

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

The resource id of the private DNS zone.

- Required: Yes
- Type: string

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

The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones.
The name of the private DNS zone group config.

- Required: No
- Type: array
- Type: string

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

The name of the Private DNS Zone Group.

- Required: No
- Type: string

### Parameter: `privateEndpoints.privateLinkServiceConnectionName`

Expand Down Expand Up @@ -1505,6 +1565,7 @@ Tags of the resource.
| `endpoint` | string | The endpoint of the app configuration. |
| `location` | string | The location the resource was deployed into. |
| `name` | string | The name of the app configuration. |
| `privateEndpoints` | array | The private endpoints of the app configuration. |
| `resourceGroupName` | string | The resource group the app configuration store was deployed into. |
| `resourceId` | string | The resource ID of the app configuration. |
| `systemAssignedMIPrincipalId` | string | The principal ID of the system assigned identity. |
Expand All @@ -1515,7 +1576,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.6.1` | Remote reference |
| `br/public:avm/res/network/private-endpoint:0.7.1` | Remote reference |

## Data Collection

Expand Down
33 changes: 26 additions & 7 deletions avm/res/app-configuration/configuration-store/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ resource configurationStore_roleAssignments 'Microsoft.Authorization/roleAssignm
]

@batchSize(1)
module configurationStore_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.6.1' = [
module configurationStore_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.7.1' = [
for (privateEndpoint, index) in (privateEndpoints ?? []): {
name: '${uniqueString(deployment().name, location)}-configurationStore-PrivateEndpoint-${index}'
scope: resourceGroup(privateEndpoint.?resourceGroupName ?? '')
Expand Down Expand Up @@ -321,8 +321,7 @@ module configurationStore_privateEndpoints 'br/public:avm/res/network/private-en
'Full'
).location
lock: privateEndpoint.?lock ?? lock
privateDnsZoneGroupName: privateEndpoint.?privateDnsZoneGroupName
privateDnsZoneResourceIds: privateEndpoint.?privateDnsZoneResourceIds
privateDnsZoneGroup: privateEndpoint.?privateDnsZoneGroup
roleAssignments: privateEndpoint.?roleAssignments
tags: privateEndpoint.?tags ?? tags
customDnsConfigs: privateEndpoint.?customDnsConfigs
Expand Down Expand Up @@ -351,6 +350,17 @@ output location string = configurationStore.location
@description('The endpoint of the app configuration.')
output endpoint string = configurationStore.properties.endpoint

@description('The private endpoints of the app configuration.')
output privateEndpoints array = [
for (pe, i) in (!empty(privateEndpoints) ? array(privateEndpoints) : []): {
name: configurationStore_privateEndpoints[i].outputs.name
resourceId: configurationStore_privateEndpoints[i].outputs.resourceId
groupId: configurationStore_privateEndpoints[i].outputs.groupId
customDnsConfig: configurationStore_privateEndpoints[i].outputs.customDnsConfig
networkInterfaceIds: configurationStore_privateEndpoints[i].outputs.networkInterfaceIds
}
]

// =============== //
// Definitions //
// =============== //
Expand Down Expand Up @@ -413,11 +423,20 @@ type privateEndpointType = {
@description('Required. Resource ID of the subnet where the endpoint needs to be created.')
subnetResourceId: string

@description('Optional. The name of the private DNS zone group to create if `privateDnsZoneResourceIds` were provided.')
privateDnsZoneGroupName: 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('Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones.')
privateDnsZoneResourceIds: string[]?
@description('Required. The resource id of the private DNS zone.')
privateDnsZoneResourceId: string
}[]
}?

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

0 comments on commit 38e79d0

Please sign in to comment.