Skip to content

Commit

Permalink
feat: Update PE implementation in alignment to latest schema (4) (#1091)
Browse files Browse the repository at this point in the history
## Description


Follow up to #1070
- Applied latest PE schema accross all modules
- Ensured that all modules deploy at least 2 PEs to wnsure there is no
concurrency issue
- Removed several dedicated `private-endpoint` tests cases if already
implemented in max

## Pipeline Reference
| Pipeline |
| - |

[![avm.res.storage.storage-account](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.storage.storage-account.yml/badge.svg?branch=feat%2Fpe-adjustments-962-946-1042&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.storage.storage-account.yml)

[![avm.res.synapse.private-link-hub](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.synapse.private-link-hub.yml/badge.svg?branch=feat%2Fpe-adjustments-962-946-1042&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.synapse.private-link-hub.yml)

[![avm.res.web.site](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.site.yml/badge.svg?branch=feat%2Fpe-adjustments-962-946-1042&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.site.yml)

[![avm.res.web.static-site](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.static-site.yml/badge.svg?branch=feat%2Fpe-adjustments-962-946-1042&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.web.static-site.yml)

## Type of Change

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

- [ ] Update to CI Environment or utlities (Non-module effecting
changes)
- [x] Azure Verified Module updates:
- [x] 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`.
  - [x] Update to documentation

---------

Co-authored-by: Sebastian Gräf <[email protected]>
Co-authored-by: Kris Baranek <[email protected]>
Co-authored-by: ChrisSidebotham-MSFT <[email protected]>
  • Loading branch information
4 people authored Mar 8, 2024
1 parent 4ecb8bc commit 00727e5
Show file tree
Hide file tree
Showing 30 changed files with 774 additions and 403 deletions.
102 changes: 97 additions & 5 deletions avm/res/storage/storage-account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,48 @@ module storageAccount 'br/public:avm/res/storage/storage-account:<version>' = {
Role: 'DeploymentValidation'
}
}
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
service: 'blob'
subnetResourceId: '<subnetResourceId>'
}
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
service: 'table'
subnetResourceId: '<subnetResourceId>'
}
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
service: 'queue'
subnetResourceId: '<subnetResourceId>'
}
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
service: 'file'
subnetResourceId: '<subnetResourceId>'
}
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
service: 'web'
subnetResourceId: '<subnetResourceId>'
}
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
service: 'dfs'
subnetResourceId: '<subnetResourceId>'
}
]
queueServices: {
diagnosticSettings: [
Expand Down Expand Up @@ -841,6 +883,48 @@ module storageAccount 'br/public:avm/res/storage/storage-account:<version>' = {
"hidden-title": "This is visible in the resource name",
"Role": "DeploymentValidation"
}
},
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"service": "blob",
"subnetResourceId": "<subnetResourceId>"
},
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"service": "table",
"subnetResourceId": "<subnetResourceId>"
},
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"service": "queue",
"subnetResourceId": "<subnetResourceId>"
},
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"service": "file",
"subnetResourceId": "<subnetResourceId>"
},
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"service": "web",
"subnetResourceId": "<subnetResourceId>"
},
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"service": "dfs",
"subnetResourceId": "<subnetResourceId>"
}
]
},
Expand Down Expand Up @@ -2544,9 +2628,10 @@ Configuration details for private endpoints. For security reasons, it is recomme
| [`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. |
| [`isManualConnection`](#parameter-privateendpointsismanualconnection) | bool | Manual PrivateLink Service Connections. |
| [`location`](#parameter-privateendpointslocation) | string | The location to deploy the private endpoint to. |
| [`lock`](#parameter-privateendpointslock) | object | Specify the type of lock. |
| [`manualPrivateLinkServiceConnections`](#parameter-privateendpointsmanualprivatelinkserviceconnections) | array | Manual PrivateLink Service Connections. |
| [`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. |
Expand Down Expand Up @@ -2673,6 +2758,13 @@ A private ip address obtained from the private endpoint's subnet.
- Required: Yes
- Type: string

### Parameter: `privateEndpoints.isManualConnection`

Manual PrivateLink Service Connections.

- Required: No
- Type: bool

### Parameter: `privateEndpoints.location`

The location to deploy the private endpoint to.
Expand Down Expand Up @@ -2716,12 +2808,12 @@ Specify the name of lock.
- Required: No
- Type: string

### Parameter: `privateEndpoints.manualPrivateLinkServiceConnections`
### Parameter: `privateEndpoints.manualConnectionRequestMessage`

Manual PrivateLink Service Connections.
A message passed to the owner of the remote resource with the manual connection request.

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

### Parameter: `privateEndpoints.name`

Expand Down Expand Up @@ -3031,7 +3123,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.3.1` | Remote reference |
| `br/public:avm/res/network/private-endpoint:0.4.0` | Remote reference |

## Notes

Expand Down
33 changes: 24 additions & 9 deletions avm/res/storage/storage-account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -353,21 +353,33 @@ resource storageAccount_roleAssignments 'Microsoft.Authorization/roleAssignments
scope: storageAccount
}]

module storageAccount_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.3.1' = [for (privateEndpoint, index) in (privateEndpoints ?? []): {
module storageAccount_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.4.0' = [for (privateEndpoint, index) in (privateEndpoints ?? []): {
name: '${uniqueString(deployment().name, location)}-StorageAccount-PrivateEndpoint-${index}'
params: {
privateLinkServiceConnections: [
name: privateEndpoint.?name ?? 'pep-${last(split(storageAccount.id, '/'))}-${privateEndpoint.service}-${index}'
privateLinkServiceConnections: privateEndpoint.?manualPrivateLinkServiceConnections != true ? [
{
name: name
name: privateEndpoint.?privateLinkServiceConnectionName ?? '${last(split(storageAccount.id, '/'))}-${privateEndpoint.service}-${index}'
properties: {
privateLinkServiceId: storageAccount.id
groupIds: [
privateEndpoint.service
]
}
}
]
name: privateEndpoint.?name ?? 'pep-${last(split(storageAccount.id, '/'))}-${privateEndpoint.service}-${index}'
] : null
manualPrivateLinkServiceConnections: privateEndpoint.?manualPrivateLinkServiceConnections == true ? [
{
name: privateEndpoint.?privateLinkServiceConnectionName ?? '${last(split(storageAccount.id, '/'))}-${privateEndpoint.service}-${index}'
properties: {
privateLinkServiceId: storageAccount.id
groupIds: [
privateEndpoint.service
]
requestMessage: privateEndpoint.?manualConnectionRequestMessage ?? 'Manual approval required.'
}
}
] : null
subnetResourceId: privateEndpoint.subnetResourceId
enableTelemetry: privateEndpoint.?enableTelemetry ?? enableTelemetry
location: privateEndpoint.?location ?? reference(split(privateEndpoint.subnetResourceId, '/subnets/')[0], '2020-06-01', 'Full').location
Expand All @@ -376,7 +388,6 @@ module storageAccount_privateEndpoints 'br/public:avm/res/network/private-endpoi
privateDnsZoneResourceIds: privateEndpoint.?privateDnsZoneResourceIds
roleAssignments: privateEndpoint.?roleAssignments
tags: privateEndpoint.?tags ?? tags
manualPrivateLinkServiceConnections: privateEndpoint.?manualPrivateLinkServiceConnections
customDnsConfigs: privateEndpoint.?customDnsConfigs
ipConfigurations: privateEndpoint.?ipConfigurations
applicationSecurityGroupResourceIds: privateEndpoint.?applicationSecurityGroupResourceIds
Expand Down Expand Up @@ -571,6 +582,13 @@ type privateEndpointType = {
@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('Optional. Manual PrivateLink Service Connections.')
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.')
Expand Down Expand Up @@ -613,9 +631,6 @@ type privateEndpointType = {
@description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
tags: object?

@description('Optional. Manual PrivateLink Service Connections.')
manualPrivateLinkServiceConnections: array?

@description('Optional. Enable/Disable usage telemetry for module.')
enableTelemetry: bool?
}[]?
Expand Down
Loading

0 comments on commit 00727e5

Please sign in to comment.