Skip to content

Commit

Permalink
feat(azure): adjust SKU and storage for yt01 and prod
Browse files Browse the repository at this point in the history
  • Loading branch information
arealmaas committed Nov 21, 2024
1 parent 9cd6385 commit b7e4909
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .azure/infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ import { Sku as SlackNotifierSku } from '../modules/functionApp/slackNotifier.bi
param slackNotifierSku SlackNotifierSku

import { Sku as PostgresSku } from '../modules/postgreSql/create.bicep'
import { StorageConfiguration as PostgresStorageConfig } from '../modules/postgreSql/create.bicep'

param postgresConfiguration {
sku: PostgresSku
storage: PostgresStorageConfig
enableIndexTuning: bool
enableQueryPerformanceInsight: bool
}
Expand Down Expand Up @@ -215,6 +217,7 @@ module postgresql '../modules/postgreSql/create.bicep' = {
? srcKeyVaultResource.getSecret('dialogportenPgAdminPassword${environment}')
: secrets.dialogportenPgAdminPassword
sku: postgresConfiguration.sku
storage: postgresConfiguration.storage
appInsightWorkspaceName: appInsights.outputs.appInsightsWorkspaceName
enableIndexTuning: postgresConfiguration.enableIndexTuning
enableQueryPerformanceInsight: postgresConfiguration.enableQueryPerformanceInsight
Expand Down
10 changes: 8 additions & 2 deletions .azure/infrastructure/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ param slackNotifierSku = {
}
param postgresConfiguration = {
sku: {
name: 'Standard_D4ads_v5'
name: 'Standard_D8ads_v5'
tier: 'GeneralPurpose'
}
enableQueryPerformanceInsight: false
storage: {
storageSizeGB: 256
iops: 1100
autoGrow: 'Enabled'
tier: 'Premium'
}
enableIndexTuning: false
enableQueryPerformanceInsight: false
}

param redisSku = {
Expand Down
4 changes: 4 additions & 0 deletions .azure/infrastructure/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ param postgresConfiguration = {
name: 'Standard_B1ms'
tier: 'Burstable'
}
storage: {
storageSizeGB: 32
autoGrow: 'Enabled'
}
enableIndexTuning: false
enableQueryPerformanceInsight: true
}
Expand Down
4 changes: 4 additions & 0 deletions .azure/infrastructure/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ param postgresConfiguration = {
name: 'Standard_B2s'
tier: 'Burstable'
}
storage: {
storageSizeGB: 32
autoGrow: 'Enabled'
}
enableIndexTuning: false
enableQueryPerformanceInsight: true
}
Expand Down
8 changes: 7 additions & 1 deletion .azure/infrastructure/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,15 @@ param slackNotifierSku = {
}
param postgresConfiguration = {
sku: {
name: 'Standard_D4ads_v5'
name: 'Standard_D8ads_v5'
tier: 'GeneralPurpose'
}
storage: {
storageSizeGB: 256
iops: 1100
autoGrow: 'Enabled'
tier: 'Premium'
}
enableIndexTuning: true
enableQueryPerformanceInsight: true
}
Expand Down
20 changes: 18 additions & 2 deletions .azure/modules/postgreSql/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,24 @@ param tags object

@export()
type Sku = {
name: 'Standard_B1ms' | 'Standard_B2s' | 'Standard_B4ms' | 'Standard_B8ms' | 'Standard_B12ms' | 'Standard_B16ms' | 'Standard_B20ms' | 'Standard_D4ads_v5'
name: 'Standard_B1ms' | 'Standard_B2s' | 'Standard_B4ms' | 'Standard_B8ms' | 'Standard_B12ms' | 'Standard_B16ms' | 'Standard_B20ms' | 'Standard_D4ads_v5' | 'Standard_D8ads_v5'
tier: 'Burstable' | 'GeneralPurpose' | 'MemoryOptimized'
}

@description('The SKU of the PostgreSQL server')
param sku Sku

@export()
type StorageConfiguration = {
storageSizeGB: int
iops: int?
autoGrow: 'Enabled' | 'Disabled'
tier: 'Premium'? // For burstable skus, this is not supported
}

@description('The storage configuration for the PostgreSQL server')
param storage StorageConfiguration

@description('Enable query performance insight')
param enableQueryPerformanceInsight bool

Expand Down Expand Up @@ -94,7 +105,12 @@ resource postgres 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' = {
version: '15'
administratorLogin: administratorLogin
administratorLoginPassword: administratorLoginPassword
storage: { storageSizeGB: 32 }
storage: {
storageSizeGB: storage.storageSizeGB
autoGrow: storage.autoGrow
iops: storage.iops
tier: storage.tier
}
dataEncryption: {
type: 'SystemManaged'
}
Expand Down

0 comments on commit b7e4909

Please sign in to comment.