Skip to content

Commit

Permalink
Fix db sku for staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceredron committed Feb 6, 2025
1 parent 84e8f1c commit 9e3fc5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
4 changes: 0 additions & 4 deletions .azure/infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ param slackUrl string
import { Sku as KeyVaultSku } from '../modules/keyvault/create.bicep'
param keyVaultSku KeyVaultSku

import { Sku as PostgresSku } from '../modules/postgreSql/create.bicep'
param postgresSku PostgresSku

var resourceGroupName = '${namePrefix}-rg'

var secrets = [
Expand Down Expand Up @@ -103,7 +100,6 @@ module postgresql '../modules/postgreSql/create.bicep' = {
srcKeyVault: srcKeyVault
srcSecretName: brokerAdminPasswordSecretName
administratorLoginPassword: brokerPgAdminPassword
sku: postgresSku
tenantId: tenantId
environment: environment
}
Expand Down
6 changes: 0 additions & 6 deletions .azure/infrastructure/params.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,3 @@ param keyVaultSku = {
name: 'standard'
family: 'A'
}
param postgresSku = {
name: readEnvironmentVariable('ENVIRONMENT') == 'test'
? 'Standard_B1ms'
: readEnvironmentVariable('ENVIRONMENT') == 'staging' ? 'Standard_B2s' : 'Standard_D2ads_v5'
tier: readEnvironmentVariable('ENVIRONMENT') == 'production' ? 'GeneralPurpose' : 'Burstable'
}
17 changes: 8 additions & 9 deletions .azure/modules/postgreSql/create.bicep
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
param namePrefix string
param location string
@secure()
param environmentKeyVaultName string
param srcSecretName string

@export()
type Sku = {
name: 'Standard_B1ms' | 'Standard_B2s' | 'Standard_D2ads_v5'
tier: 'Burstable' | 'GeneralPurpose' | 'MemoryOptimized'
}
param sku Sku
param environment string
@secure()
param srcKeyVault object

@secure()
param administratorLoginPassword string
@secure()
Expand Down Expand Up @@ -52,6 +45,7 @@ resource postgres 'Microsoft.DBforPostgreSQL/flexibleServers@2023-12-01-preview'
administratorLoginPassword: administratorLoginPassword
storage: {
storageSizeGB: 32
tier: environment == 'test' ? 'P4' : 'P20'
}
backup: { backupRetentionDays: 35 }
authConfig: {
Expand All @@ -60,7 +54,12 @@ resource postgres 'Microsoft.DBforPostgreSQL/flexibleServers@2023-12-01-preview'
tenantId: tenantId
}
}
sku: sku
sku: {
name: environment == 'test'
? 'Standard_B1ms'
: 'Standard_D2ds_v5'
tier: environment == 'test' ? 'Burstable' : 'GeneralPurpose'
}
}

resource database 'Microsoft.DBforPostgreSQL/flexibleServers/databases@2023-12-01-preview' = {
Expand Down

0 comments on commit 9e3fc5b

Please sign in to comment.