Skip to content

Update Key Vault to Support Delete Protection #1349

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

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
1 change: 1 addition & 0 deletions docs/_resources/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Legend:
> βž• Added:
>
> 1. Cost Management export modules for subscriptions and resource groups.
> 2. Enabled Purge protection for Azure keyvault resource

<br><a name="latest"></a>

Expand Down
4 changes: 4 additions & 0 deletions src/templates/finops-hub/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ param dataExplorerFinalRetentionInMonths int = 13
@description('Optional. Enable public access to FinOps hubs resources. Default: true.')
param enablePublicAccess bool = true

@description('Optional. Enable purge protection for Azure KeyVault. Default: false.')
param enablePurgeProtection bool = false

@description('Optional. Address space for the workload. A /26 is required for the workload. Default: "10.20.30.0/26".')
param virtualNetworkAddressPrefix string = '10.20.30.0/26'

Expand Down Expand Up @@ -164,6 +167,7 @@ module hub 'modules/hub.bicep' = {
remoteHubStorageUri: remoteHubStorageUri
remoteHubStorageKey: remoteHubStorageKey
enablePublicAccess: enablePublicAccess
enablePurgeProtection: enablePurgeProtection
virtualNetworkAddressPrefix: virtualNetworkAddressPrefix
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/templates/finops-hub/modules/hub.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ param dataExplorerFinalRetentionInMonths int = 13
@description('Optional. Enable public access to the data lake. Default: true.')
param enablePublicAccess bool = true

@description('Optional. Enable purge protection of the keyvault. Default: false.')
param enablePurgeProtection bool = false

@description('Optional. Address space for the workload. A /26 is required for the workload. Default: "10.20.30.0/26".')
param virtualNetworkAddressPrefix string = '10.20.30.0/26'

Expand Down Expand Up @@ -361,6 +364,7 @@ module keyVault 'keyVault.bicep' = {
enablePublicAccess: enablePublicAccess
virtualNetworkId: safeVnetId
privateEndpointSubnetId:safeFinopsHubSubnetId
enablePurgeProtection: enablePurgeProtection
accessPolicies: [
{
objectId: dataFactory.identity.principalId
Expand Down
4 changes: 4 additions & 0 deletions src/templates/finops-hub/modules/keyVault.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ param privateEndpointSubnetId string
@description('Optional. Enable public access to the data lake. Default: false.')
param enablePublicAccess bool

@description('Optional. Enable purge protection to the keyvault. Default: false')
param enablePurgeProtection bool

//------------------------------------------------------------------------------
// Variables
//------------------------------------------------------------------------------
Expand Down Expand Up @@ -77,6 +80,7 @@ resource keyVault 'Microsoft.KeyVault/vaults@2023-02-01' = {
enableSoftDelete: true
softDeleteRetentionInDays: 90
enableRbacAuthorization: false
enablePurgeProtection: enablePurgeProtection
createMode: 'default'
tenantId: subscription().tenantId
accessPolicies: formattedAccessPolicies
Expand Down