Skip to content
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

feat(azure): adjust SKU and storage for yt01 and prod #1508

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
}

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'
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
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
}
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
dataEncryption: {
type: 'SystemManaged'
}
Expand Down
Loading