-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #783 from Azure/mqtt-private-endpoint
Add private endpoint for eventgrid
- Loading branch information
Showing
5 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
param location string | ||
|
||
@description('The service type the private endpoint is created for') | ||
@allowed([ | ||
'eventgrid' | ||
]) | ||
param serviceType string | ||
|
||
@description('The group id of the private endpoint service') | ||
@allowed([ | ||
'topicspace' | ||
]) | ||
param groupId string | ||
|
||
@description('The private link service id') | ||
param privateLinkServiceId string | ||
|
||
@description('The subnet ids to create the private endpoint in') | ||
param subnetIds array | ||
|
||
@description('The vnet id to link the private endpoint to') | ||
param vnetId string | ||
|
||
var endpointConfig = { | ||
eventgrid: { | ||
topicspace: 'privatelink.ts.eventgrid.azure.net' | ||
} | ||
} | ||
|
||
resource eventGridPrivateEndpointDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { | ||
name: endpointConfig[serviceType][groupId] | ||
location: 'global' | ||
properties: {} | ||
} | ||
|
||
resource privatEndpoint 'Microsoft.Network/privateEndpoints@2023-09-01' = [ | ||
for aksNodeSubnetId in subnetIds: { | ||
name: '${serviceType}-${uniqueString(aksNodeSubnetId)}' | ||
location: location | ||
properties: { | ||
privateLinkServiceConnections: [ | ||
{ | ||
name: '${serviceType}-private-endpoint' | ||
properties: { | ||
privateLinkServiceId: privateLinkServiceId | ||
groupIds: [groupId] | ||
} | ||
} | ||
] | ||
subnet: { | ||
id: aksNodeSubnetId | ||
} | ||
} | ||
} | ||
] | ||
|
||
resource privateEndpointDnsGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2023-09-01' = [ | ||
for index in range(0, length(subnetIds)): { | ||
name: '${serviceType}-${uniqueString(subnetIds[index])}' | ||
parent: privatEndpoint[index] | ||
properties: { | ||
privateDnsZoneConfigs: [ | ||
{ | ||
name: 'config1' | ||
properties: { | ||
privateDnsZoneId: eventGridPrivateEndpointDnsZone.id | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
|
||
resource eventGridPrivateDnsZoneVnetLink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2020-06-01' = { | ||
name: uniqueString('eventgrid-${uniqueString(vnetId)}') | ||
parent: eventGridPrivateEndpointDnsZone | ||
location: 'global' | ||
properties: { | ||
registrationEnabled: false | ||
virtualNetwork: { | ||
id: vnetId | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters