forked from Azure/ARO-HCP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move private endpoint to a seperate module * Add shared keyvault
- Loading branch information
Showing
10 changed files
with
106 additions
and
79 deletions.
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
REGION ?= westus3 | ||
RESOURCEGROUP ?= cs-integ-$(USER)-$(REGION)-$(AKSCONFIG) | ||
REGIONAL_RESOURCEGROUP ?= cs-integ-$(USER)-$(REGION) | ||
SVC_KV_RESOURCEGROUP ?= global | ||
ARO_HCP_IMAGE_ACR ?= arohcpdev | ||
REGIONAL_ACR_NAME ?= arohcpdev$(shell echo $(CURRENTUSER) | sha256sum | head -c 24) | ||
|
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
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
77 changes: 77 additions & 0 deletions
77
dev-infrastructure/modules/keyvault/keyvault-private-endpoint.bicep
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,77 @@ | ||
@description('Location of the endpoint.') | ||
param location string | ||
|
||
@description('Name of the key vault to create this endpoint for.') | ||
param keyVaultName string | ||
|
||
@description('ID of the subnet to create the private endpoint in.') | ||
param subnetId string | ||
|
||
@description('ID of the vnet, needs to correlated with subnetId.') | ||
param vnetId string | ||
|
||
@description('ID of the key vault.') | ||
param keyVaultId string | ||
|
||
// | ||
// P R I V A T E E N D P O I N T | ||
// | ||
|
||
var privateDnsZoneName = 'privatelink.vaultcore.azure.net' | ||
|
||
resource keyVaultPrivateEndpoint 'Microsoft.Network/privateEndpoints@2024-01-01' = { | ||
name: '${keyVaultName}-pe' | ||
location: location | ||
properties: { | ||
privateLinkServiceConnections: [ | ||
{ | ||
name: '${keyVaultName}-pe' | ||
properties: { | ||
groupIds: [ | ||
'vault' | ||
] | ||
privateLinkServiceId: keyVaultId | ||
} | ||
} | ||
] | ||
subnet: { | ||
id: subnetId | ||
} | ||
} | ||
} | ||
|
||
resource keyVaultPrivateEndpointDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' = { | ||
name: privateDnsZoneName | ||
location: 'global' | ||
properties: {} | ||
} | ||
|
||
resource keyVaultPrivateDnsZoneVnetLink 'Microsoft.Network/privateDnsZones/virtualNetworkLinks@2020-06-01' = { | ||
parent: keyVaultPrivateEndpointDnsZone | ||
name: uniqueString(keyVaultId) | ||
location: 'global' | ||
properties: { | ||
registrationEnabled: false | ||
virtualNetwork: { | ||
id: vnetId | ||
} | ||
} | ||
} | ||
|
||
resource privateEndpointDnsGroup 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2023-09-01' = { | ||
parent: keyVaultPrivateEndpoint | ||
name: '${keyVaultName}-dns-group' | ||
properties: { | ||
privateDnsZoneConfigs: [ | ||
{ | ||
name: 'config1' | ||
properties: { | ||
privateDnsZoneId: keyVaultPrivateEndpointDnsZone.id | ||
} | ||
} | ||
] | ||
} | ||
dependsOn: [ | ||
keyVaultPrivateDnsZoneVnetLink | ||
] | ||
} |
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