Created
January 7, 2025 21:26
-
-
Save mmckechney/7663b3f290a70b17b69f3a8e32d5caa2 to your computer and use it in GitHub Desktop.
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
param keyvaultName string | |
param currentIpAddress string | |
param identityClientId string | |
param subNet1Id string | |
param subNet2Id string | |
param subNet3Id string | |
param subNet4Id string | |
param location string = resourceGroup().location | |
resource keyVaultResource 'Microsoft.KeyVault/vaults@2019-09-01' = { | |
name: keyvaultName | |
location: location | |
properties: { | |
enabledForTemplateDeployment: true | |
enableRbacAuthorization: true | |
tenantId: subscription().tenantId | |
sku: { | |
family: 'A' | |
name: 'standard' | |
} | |
accessPolicies:[ | |
{ | |
tenantId: subscription().tenantId | |
objectId:identityClientId | |
permissions: { | |
secrets:[ | |
'set' | |
'list' | |
'get' | |
] | |
} | |
} | |
] | |
networkAcls: { | |
bypass: 'AzureServices' | |
defaultAction: 'Deny' | |
ipRules: [ | |
{ | |
value: currentIpAddress | |
} | |
] | |
virtualNetworkRules: [ | |
{ | |
id: subNet1Id | |
ignoreMissingVnetServiceEndpoint: false | |
} | |
{ | |
id: subNet2Id | |
ignoreMissingVnetServiceEndpoint: false | |
} | |
{ | |
id: subNet3Id | |
ignoreMissingVnetServiceEndpoint: false | |
} | |
{ | |
id: subNet4Id | |
ignoreMissingVnetServiceEndpoint: false | |
} | |
] | |
} | |
} | |
} | |
output keyVaultResourceId string = keyVaultResource.id | |
output keyVaultUrl string = keyVaultResource.properties.vaultUri | |
output keyVaultName string = keyVaultResource.name | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment