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 (4) #1091

Merged
merged 31 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
31 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
63c7309
Update to latest
AlexanderSehr Feb 27, 2024
8336010
Update to latest
AlexanderSehr Feb 27, 2024
e142af4
Update to latest
AlexanderSehr Mar 8, 2024
16cf974
Merge branch 'main' into feat/pe-adjustments-962-946-1042_4
ChrisSidebotham Mar 8, 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
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 @@ -439,6 +439,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 @@ -829,6 +871,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 @@ -2511,9 +2595,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 @@ -2640,6 +2725,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 @@ -2683,12 +2775,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 @@ -2998,7 +3090,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 @@ -352,21 +352,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 @@ -375,7 +387,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 @@ -564,6 +575,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 @@ -606,9 +624,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
67 changes: 34 additions & 33 deletions avm/res/storage/storage-account/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "9001266032995338880"
"templateHash": "2079881859262732934"
},
"name": "Storage Accounts",
"description": "This module deploys a Storage Account.",
Expand Down Expand Up @@ -227,6 +227,21 @@
"description": "Optional. The private DNS zone groups to associate the private endpoint with. A DNS zone group can support up to 5 DNS zones."
}
},
"isManualConnection": {
"type": "bool",
"nullable": true,
"metadata": {
"description": "Optional. Manual PrivateLink Service Connections."
}
},
"manualConnectionRequestMessage": {
"type": "string",
"nullable": true,
"maxLength": 140,
"metadata": {
"description": "Optional. A message passed to the owner of the remote resource with the manual connection request."
}
},
"customDnsConfigs": {
"type": "array",
"items": {
Expand Down Expand Up @@ -335,13 +350,6 @@
"description": "Optional. Tags to be applied on all resources/resource groups in this deployment."
}
},
"manualPrivateLinkServiceConnections": {
"type": "array",
"nullable": true,
"metadata": {
"description": "Optional. Manual PrivateLink Service Connections."
}
},
"enableTelemetry": {
"type": "bool",
"nullable": true,
Expand Down Expand Up @@ -995,22 +1003,11 @@
},
"mode": "Incremental",
"parameters": {
"privateLinkServiceConnections": {
"value": [
{
"name": "[parameters('name')]",
"properties": {
"privateLinkServiceId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('name'))]",
"groupIds": [
"[coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].service]"
]
}
}
]
},
"name": {
"value": "[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'name'), format('pep-{0}-{1}-{2}', last(split(resourceId('Microsoft.Storage/storageAccounts', parameters('name')), '/')), coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].service, copyIndex()))]"
},
"privateLinkServiceConnections": "[if(not(equals(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'manualPrivateLinkServiceConnections'), true())), createObject('value', createArray(createObject('name', coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'privateLinkServiceConnectionName'), format('{0}-{1}-{2}', last(split(resourceId('Microsoft.Storage/storageAccounts', parameters('name')), '/')), coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].service, copyIndex())), 'properties', createObject('privateLinkServiceId', resourceId('Microsoft.Storage/storageAccounts', parameters('name')), 'groupIds', createArray(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].service))))), createObject('value', null()))]",
"manualPrivateLinkServiceConnections": "[if(equals(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'manualPrivateLinkServiceConnections'), true()), createObject('value', createArray(createObject('name', coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'privateLinkServiceConnectionName'), format('{0}-{1}-{2}', last(split(resourceId('Microsoft.Storage/storageAccounts', parameters('name')), '/')), coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].service, copyIndex())), 'properties', createObject('privateLinkServiceId', resourceId('Microsoft.Storage/storageAccounts', parameters('name')), 'groupIds', createArray(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].service), 'requestMessage', coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'manualConnectionRequestMessage'), 'Manual approval required.'))))), createObject('value', null()))]",
"subnetResourceId": {
"value": "[coalesce(parameters('privateEndpoints'), createArray())[copyIndex()].subnetResourceId]"
},
Expand All @@ -1035,9 +1032,6 @@
"tags": {
"value": "[coalesce(tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'tags'), parameters('tags'))]"
},
"manualPrivateLinkServiceConnections": {
"value": "[tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'manualPrivateLinkServiceConnections')]"
},
"customDnsConfigs": {
"value": "[tryGet(coalesce(parameters('privateEndpoints'), createArray())[copyIndex()], 'customDnsConfigs')]"
},
Expand All @@ -1058,8 +1052,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
"templateHash": "2821141217598568122"
"version": "0.24.24.22086",
"templateHash": "2592884001616184297"
},
"name": "Private Endpoints",
"description": "This module deploys a Private Endpoint.",
Expand Down Expand Up @@ -1108,7 +1102,7 @@
"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\""
"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": {
Expand Down Expand Up @@ -1186,7 +1180,7 @@
"privateIPAddress": {
"type": "string",
"metadata": {
"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."
}
}
},
Expand Down Expand Up @@ -1289,7 +1283,7 @@
"fqdn": {
"type": "string",
"metadata": {
"description": "Required. Fqdn that resolves to private endpoint ip address."
"description": "Required. Fqdn that resolves to private endpoint IP address."
}
},
"ipAddresses": {
Expand All @@ -1298,7 +1292,7 @@
"type": "string"
},
"metadata": {
"description": "Required. A list of private ip addresses of the private endpoint."
"description": "Required. A list of private IP addresses of the private endpoint."
}
}
}
Expand Down Expand Up @@ -1424,7 +1418,7 @@
"condition": "[parameters('enableTelemetry')]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2023-07-01",
"name": "[format('46d3xbcp.res.network-privateendpoint.{0}.{1}', replace('0.3.1', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]",
"name": "[format('46d3xbcp.res.network-privateendpoint.{0}.{1}', replace('0.4.0', '.', '-'), substring(uniqueString(deployment().name, parameters('location')), 0, 4))]",
"properties": {
"mode": "Incremental",
"template": {
Expand Down Expand Up @@ -1529,8 +1523,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.23.1.45101",
"templateHash": "18168683629401652671"
"version": "0.24.24.22086",
"templateHash": "9321937464667207030"
},
"name": "Private Endpoint Private DNS Zone Groups",
"description": "This module deploys a Private Endpoint Private DNS Zone Group.",
Expand Down Expand Up @@ -1641,6 +1635,13 @@
"description": "The location the resource was deployed into."
},
"value": "[reference('privateEndpoint', '2023-04-01', 'full').location]"
},
"groupId": {
"type": "string",
"metadata": {
"description": "The group Id for the private endpoint Group."
},
"value": "[if(not(empty(reference('privateEndpoint').manualPrivateLinkServiceConnections)), reference('privateEndpoint').manualPrivateLinkServiceConnections[0].properties.groupIds[0], reference('privateEndpoint').privateLinkServiceConnections[0].properties.groupIds[0])]"
}
}
}
Expand Down
Loading
Loading