Skip to content

Commit

Permalink
feat: Update PE implementation in alignment to latest schema (3) (#1090)
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.insights.private-link-scope](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.insights.private-link-scope.yml/badge.svg?branch=feat%2Fpe-adjustments-962-946-1042&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.insights.private-link-scope.yml)

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

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

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

[![avm.res.sql.server](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.sql.server.yml/badge.svg?branch=feat%2Fpe-adjustments-962-946-1042&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.sql.server.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]>
  • Loading branch information
3 people authored Mar 8, 2024
1 parent 213e31b commit 4ecb8bc
Show file tree
Hide file tree
Showing 36 changed files with 547 additions and 1,216 deletions.
38 changes: 23 additions & 15 deletions avm/res/insights/private-link-scope/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -931,14 +931,15 @@ 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 | If Manual Private Link Connection is required. |
| [`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. |
| [`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. |
| [`roleAssignments`](#parameter-privateendpointsroleassignments) | array | Array of role assignments to create. |
| [`service`](#parameter-privateendpointsservice) | string | The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob". |
| [`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. |

### Parameter: `privateEndpoints.subnetResourceId`
Expand Down Expand Up @@ -966,19 +967,19 @@ Custom DNS configurations.

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`fqdn`](#parameter-privateendpointscustomdnsconfigsfqdn) | string | Fqdn that resolves to private endpoint ip address. |
| [`ipAddresses`](#parameter-privateendpointscustomdnsconfigsipaddresses) | array | A list of private ip addresses of the private endpoint. |
| [`fqdn`](#parameter-privateendpointscustomdnsconfigsfqdn) | string | Fqdn that resolves to private endpoint IP address. |
| [`ipAddresses`](#parameter-privateendpointscustomdnsconfigsipaddresses) | array | A list of private IP addresses of the private endpoint. |

### Parameter: `privateEndpoints.customDnsConfigs.fqdn`

Fqdn that resolves to private endpoint ip address.
Fqdn that resolves to private endpoint IP address.

- Required: No
- Type: string

### Parameter: `privateEndpoints.customDnsConfigs.ipAddresses`

A list of private ip addresses of the private endpoint.
A list of private IP addresses of the private endpoint.

- Required: Yes
- Type: array
Expand Down Expand Up @@ -1031,7 +1032,7 @@ Properties of private endpoint IP configurations.
| :-- | :-- | :-- |
| [`groupId`](#parameter-privateendpointsipconfigurationspropertiesgroupid) | string | The ID of a group obtained from the remote resource that this private endpoint should connect to. |
| [`memberName`](#parameter-privateendpointsipconfigurationspropertiesmembername) | string | The member name of a group obtained from the remote resource that this private endpoint should connect to. |
| [`privateIPAddress`](#parameter-privateendpointsipconfigurationspropertiesprivateipaddress) | string | A private ip address obtained from the private endpoint's subnet. |
| [`privateIPAddress`](#parameter-privateendpointsipconfigurationspropertiesprivateipaddress) | string | A private IP address obtained from the private endpoint's subnet. |

### Parameter: `privateEndpoints.ipConfigurations.properties.groupId`

Expand All @@ -1049,11 +1050,18 @@ The member name of a group obtained from the remote resource that this private e

### Parameter: `privateEndpoints.ipConfigurations.properties.privateIPAddress`

A private ip address obtained from the private endpoint's subnet.
A private IP address obtained from the private endpoint's subnet.

- Required: Yes
- Type: string

### Parameter: `privateEndpoints.isManualConnection`

If Manual Private Link Connection is required.

- Required: No
- Type: bool

### Parameter: `privateEndpoints.location`

The location to deploy the private endpoint to.
Expand Down Expand Up @@ -1097,12 +1105,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 All @@ -1113,7 +1121,7 @@ The name of the private endpoint.

### Parameter: `privateEndpoints.privateDnsZoneGroupName`

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

- Required: No
- Type: string
Expand Down Expand Up @@ -1216,7 +1224,7 @@ The principal type of the assigned principal ID.

### Parameter: `privateEndpoints.service`

The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob".
The subresource to deploy the private endpoint for. For example "vault", "mysqlServer" or "dataFactory".

- Required: No
- Type: string
Expand Down Expand Up @@ -1368,7 +1376,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 |

## Data Collection

Expand Down
41 changes: 28 additions & 13 deletions avm/res/insights/private-link-scope/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,13 @@ resource privateLinkScope_lock 'Microsoft.Authorization/locks@2020-05-01' = if (
scope: privateLinkScope
}

module privateLinkScope_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.3.1' = [for (privateEndpoint, index) in (privateEndpoints ?? []): {
module privateLinkScope_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.4.0' = [for (privateEndpoint, index) in (privateEndpoints ?? []): {
name: '${uniqueString(deployment().name, location)}-PrivateLinkScope-PrivateEndpoint-${index}'
params: {
name: privateEndpoint.?name ?? 'pep-${last(split(privateLinkScope.id, '/'))}-${privateEndpoint.?service ?? 'azuremonitor'}-${index}'
privateLinkServiceConnections: [
{
name: name
name: privateEndpoint.?privateLinkServiceConnectionName ?? '${last(split(privateLinkScope.id, '/'))}-${privateEndpoint.?service ?? 'azuremonitor'}-${index}'
properties: {
privateLinkServiceId: privateLinkScope.id
groupIds: [
Expand All @@ -117,16 +118,26 @@ module privateLinkScope_privateEndpoints 'br/public:avm/res/network/private-endp
}
}
]
name: privateEndpoint.?name ?? 'pep-${last(split(privateLinkScope.id, '/'))}-${privateEndpoint.?service ?? 'azuremonitor'}-${index}'
manualPrivateLinkServiceConnections: privateEndpoint.?manualPrivateLinkServiceConnections == true ? [
{
name: privateEndpoint.?privateLinkServiceConnectionName ?? '${last(split(privateLinkScope.id, '/'))}-${privateEndpoint.?service ?? 'azuremonitor'}-${index}'
properties: {
privateLinkServiceId: privateLinkScope.id
groupIds: [
privateEndpoint.?service ?? 'azuremonitor'
]
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
lock: privateEndpoint.?lock ?? lock
enableTelemetry: privateEndpoint.?enableTelemetry ?? enableTelemetry
privateDnsZoneGroupName: privateEndpoint.?privateDnsZoneGroupName
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 @@ -202,24 +213,31 @@ type privateEndpointType = {
@description('Optional. The location to deploy the private endpoint to.')
location: string?

@description('Optional. The service (sub-) type to deploy the private endpoint for. For example "vault" or "blob".')
@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 name of the private DNS zone group to create if privateDnsZoneResourceIds were provided.')
@description('Optional. The name of the private DNS zone group to create if `privateDnsZoneResourceIds` were provided.')
privateDnsZoneGroupName: 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('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.')
@description('Required. Fqdn that resolves to private endpoint IP address.')
fqdn: string?

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

Expand All @@ -236,7 +254,7 @@ type privateEndpointType = {
@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.')
@description('Required. A private IP address obtained from the private endpoint\'s subnet.')
privateIPAddress: string
}
}[]?
Expand All @@ -256,9 +274,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 4ecb8bc

Please sign in to comment.