Skip to content

Commit

Permalink
move persist tag management to *-infra.bicep
Browse files Browse the repository at this point in the history
both svc and mgmt infra will manage the persist tag in the infra portion of their templates.
background: we want to be able to ramp infra without clusters for various testing purposes,
hence only the infra templates might run and RG tagging needs to run as part of that

Signed-off-by: Gerd Oberlechner <[email protected]>
  • Loading branch information
geoberle committed Dec 20, 2024
1 parent d345e2d commit 2d8d412
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
8 changes: 6 additions & 2 deletions dev-infrastructure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ svc: svc.rg
--template-file templates/svc-infra.bicep \
$(PROMPT_TO_CONFIRM) \
--parameters \
configurations/svc-infra.bicepparam
configurations/svc-infra.bicepparam \
--parameters \
persist=${PERSIST}
@./ensure-no-running-deployment.sh $(SVC_RESOURCEGROUP) $(SVC_RG_DEPLOYMENT_NAME)
az deployment group create \
--name $(SVC_RG_DEPLOYMENT_NAME) \
Expand Down Expand Up @@ -322,7 +324,9 @@ mgmt: mgmt.wait mgmt.rg
--template-file templates/mgmt-infra.bicep \
$(PROMPT_TO_CONFIRM) \
--parameters \
configurations/mgmt-infra.bicepparam
configurations/mgmt-infra.bicepparam \
--parameters \
persist=${PERSIST}
@scripts/cleanup-orphaned-rolebindings.sh $(MGMT_RESOURCEGROUP)
az deployment group create \
--name $(MGMG_RG_DEPLOYMENT_NAME) \
Expand Down
11 changes: 0 additions & 11 deletions dev-infrastructure/templates/svc-cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,6 @@ resource serviceKeyVault 'Microsoft.KeyVault/vaults@2024-04-01-preview' existing
scope: resourceGroup(serviceKeyVaultResourceGroup)
}

// Tags the resource group
resource subscriptionTags 'Microsoft.Resources/tags@2024-03-01' = {
name: 'default'
scope: resourceGroup()
properties: {
tags: {
persist: toLower(string(persist))
}
}
}

module svcCluster '../modules/aks-cluster-base.bicep' = {
name: 'cluster'
scope: resourceGroup()
Expand Down
14 changes: 14 additions & 0 deletions dev-infrastructure/templates/svc-infra.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ param certName string
@description('This is a regional DNS zone')
param regionalDNSZoneName string

@description('Set to true to prevent resources from being pruned after 48 hours')
param persist bool = false

// Tags the resource group
resource resourcegroupTags 'Microsoft.Resources/tags@2024-03-01' = {
name: 'default'
scope: resourceGroup()
properties: {
tags: {
persist: toLower(string(persist))
}
}
}

//
// K E Y V A U L T S
//
Expand Down

0 comments on commit 2d8d412

Please sign in to comment.