Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update PE implementation in alignment to latest schema (2) #1089

Merged
merged 28 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c12dc1b
PE adjustments (#1070)
segraef Feb 25, 2024
3a2572a
Update to latest
AlexanderSehr Feb 25, 2024
f510b12
Several fixes
AlexanderSehr Feb 25, 2024
ef334ce
More updates
AlexanderSehr Feb 25, 2024
ad38957
Expanded tests
AlexanderSehr Feb 25, 2024
e11cbd9
Refreshed JSON
AlexanderSehr Feb 25, 2024
7989ce0
Update to latest
AlexanderSehr Feb 25, 2024
a96d94b
Added missing tryGet
AlexanderSehr Feb 25, 2024
54ba237
Updated site docs
AlexanderSehr Feb 25, 2024
080fa8e
Merged latest main
AlexanderSehr Feb 25, 2024
a2d88ab
Update to latest
AlexanderSehr Feb 25, 2024
3aa7a03
Update to latest
AlexanderSehr Feb 25, 2024
e3fefb6
Update to latest
AlexanderSehr Feb 25, 2024
ff0819c
Update to latest
AlexanderSehr Feb 25, 2024
6e8af04
Update to latest
AlexanderSehr Feb 25, 2024
b06858d
Fixed incorrect groupId for synapse privateLinkHub
AlexanderSehr Feb 25, 2024
e79edcb
feat: added additional PE tests (#1077)
segraef Feb 26, 2024
c867e8e
Update to latest
AlexanderSehr Feb 26, 2024
a98d5f6
Update to latest
AlexanderSehr Feb 26, 2024
ee1ceb9
Update to latest
AlexanderSehr Feb 26, 2024
b703187
Update to latest
AlexanderSehr Feb 26, 2024
b86b2db
Regen docs
AlexanderSehr Feb 26, 2024
47a42d4
Updated tests with explicit dependency
AlexanderSehr Feb 26, 2024
846b512
Added explicit dependencies
AlexanderSehr Feb 26, 2024
3befb25
Update to latest
AlexanderSehr Feb 26, 2024
8805574
Update to latest
AlexanderSehr Feb 26, 2024
b6dbfb9
Merge branch 'main' into feat/pe-adjustments-962-946-1042
AlexanderSehr Feb 27, 2024
a5f2239
Update to latest
AlexanderSehr Feb 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 29 additions & 80 deletions avm/res/desktop-virtualization/host-pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ The following section provides usage examples for the module, which were used to

- [Using only defaults](#example-1-using-only-defaults)
- [Using large parameter set](#example-2-using-large-parameter-set)
- [Using Private Endpoints](#example-3-using-private-endpoints)
- [WAF-aligned](#example-4-waf-aligned)
- [WAF-aligned](#example-3-waf-aligned)

### Example 1: _Using only defaults_

Expand Down Expand Up @@ -148,6 +147,12 @@ module hostPool 'br/public:avm/res/desktop-virtualization/host-pool:<version>' =
]
subnetResourceId: '<subnetResourceId>'
}
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
subnetResourceId: '<subnetResourceId>'
}
]
publicNetworkAccess: 'Disabled'
roleAssignments: [
Expand Down Expand Up @@ -278,6 +283,12 @@ module hostPool 'br/public:avm/res/desktop-virtualization/host-pool:<version>' =
},
"privateEndpoints": {
"value": [
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"subnetResourceId": "<subnetResourceId>"
},
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
Expand Down Expand Up @@ -341,77 +352,7 @@ module hostPool 'br/public:avm/res/desktop-virtualization/host-pool:<version>' =
</details>
<p>

### Example 3: _Using Private Endpoints_

This instance deploys the module with Private Endpoints.


<details>

<summary>via Bicep module</summary>

```bicep
module hostPool 'br/public:avm/res/desktop-virtualization/host-pool:<version>' = {
name: '${uniqueString(deployment().name, resourceLocation)}-test-dvhppe'
params: {
// Required parameters
name: 'dvhppe001'
// Non-required parameters
location: '<location>'
privateEndpoints: [
{
privateDnsZoneResourceIds: [
'<privateDNSZoneResourceId>'
]
subnetResourceId: '<subnetResourceId>'
}
]
publicNetworkAccess: 'Disabled'
}
}
```

</details>
<p>

<details>

<summary>via JSON Parameter file</summary>

```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"name": {
"value": "dvhppe001"
},
// Non-required parameters
"location": {
"value": "<location>"
},
"privateEndpoints": {
"value": [
{
"privateDnsZoneResourceIds": [
"<privateDNSZoneResourceId>"
],
"subnetResourceId": "<subnetResourceId>"
}
]
},
"publicNetworkAccess": {
"value": "Disabled"
}
}
}
```

</details>
<p>

### Example 4: _WAF-aligned_
### Example 3: _WAF-aligned_

This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework.

Expand Down Expand Up @@ -836,14 +777,15 @@ Configuration details for private endpoints.
| [`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. |
| [`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 "connection". |
| [`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 @@ -959,6 +901,13 @@ 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 @@ -1002,12 +951,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 @@ -1121,7 +1070,7 @@ The principal type of the assigned principal ID.

### Parameter: `privateEndpoints.service`

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

- Required: No
- Type: string
Expand Down Expand Up @@ -1352,7 +1301,7 @@ This section gives you an overview of all local-referenced module files (i.e., o

| Reference | Type |
| :-- | :-- |
| `br/public:avm-res-network-privateendpoint:0.1.1` | Remote reference |
| `br/public:avm/res/network/private-endpoint:0.4.0` | Remote reference |

## Data Collection

Expand Down
46 changes: 34 additions & 12 deletions avm/res/desktop-virtualization/host-pool/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -196,22 +196,41 @@ resource hostPool 'Microsoft.DesktopVirtualization/hostPools@2023-09-05' = {
}
}

module hostPool_privateEndpoints 'br/public:avm-res-network-privateendpoint:0.1.1' = [for (privateEndpoint, index) in (privateEndpoints ?? []): {
module hostPool_privateEndpoints 'br/public:avm/res/network/private-endpoint:0.4.0' = [for (privateEndpoint, index) in (privateEndpoints ?? []): {
name: '${uniqueString(deployment().name, location)}-HostPool-PrivateEndpoint-${index}'
params: {
groupIds: [
privateEndpoint.?service ?? 'connection'
]
name: privateEndpoint.?name ?? 'pep-${last(split(hostPool.id, '/'))}-${privateEndpoint.?service ?? 'connection'}-${index}'
serviceResourceId: hostPool.id
privateLinkServiceConnections: [
{
name: privateEndpoint.?privateLinkServiceConnectionName ?? '${last(split(hostPool.id, '/'))}-${privateEndpoint.?service ?? 'connection'}-${index}'
properties: {
privateLinkServiceId: hostPool.id
groupIds: [
privateEndpoint.?service ?? 'connection'
]
}
}
]
manualPrivateLinkServiceConnections: privateEndpoint.?manualPrivateLinkServiceConnections == true ? [
{
name: privateEndpoint.?privateLinkServiceConnectionName ?? '${last(split(hostPool.id, '/'))}-${privateEndpoint.?service ?? 'connection'}-${index}'
properties: {
privateLinkServiceId: hostPool.id
groupIds: [
privateEndpoint.?service ?? 'connection'
]
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 @@ -335,14 +354,13 @@ type roleAssignmentType = {
}[]?

type privateEndpointType = {

@sys.description('Optional. The name of the private endpoint.')
name: string?

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

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

@sys.description('Required. Resource ID of the subnet where the endpoint needs to be created.')
Expand All @@ -354,6 +372,13 @@ type privateEndpointType = {
@sys.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[]?

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

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

@sys.description('Optional. Custom DNS configurations.')
customDnsConfigs: {
@sys.description('Required. Fqdn that resolves to private endpoint IP address.')
Expand Down Expand Up @@ -396,9 +421,6 @@ type privateEndpointType = {
@sys.description('Optional. Tags to be applied on all resources/resource groups in this deployment.')
tags: object?

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

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