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 all commits
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
autoGrow: 'Enabled'
tier: 'P15'
type: 'Premium_LRS'
}
enableIndexTuning: false
enableQueryPerformanceInsight: false
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
}

param redisSku = {
Expand Down
5 changes: 5 additions & 0 deletions .azure/infrastructure/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ param postgresConfiguration = {
name: 'Standard_B1ms'
tier: 'Burstable'
}
storage: {
storageSizeGB: 32
autoGrow: 'Enabled'
type: 'Premium_LRS'
}
enableIndexTuning: false
enableQueryPerformanceInsight: true
}
Expand Down
5 changes: 5 additions & 0 deletions .azure/infrastructure/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ param postgresConfiguration = {
name: 'Standard_B2s'
tier: 'Burstable'
}
storage: {
storageSizeGB: 32
autoGrow: 'Enabled'
type: 'Premium_LRS'
}
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
autoGrow: 'Enabled'
tier: 'P15'
type: 'Premium_LRS'
}
enableIndexTuning: true
enableQueryPerformanceInsight: true
}
Expand Down
23 changes: 21 additions & 2 deletions .azure/modules/postgreSql/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,27 @@ 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 = {
@minValue(32)
storageSizeGB: int
autoGrow: 'Enabled' | 'Disabled'
@description('The type of storage account to use. Default is Premium_LRS.')
type: 'Premium_LRS' | 'PremiumV2_LRS'
@description('Required when type is Premium_LRS or PremiumV2_LRS')
tier: 'P1' | 'P2' | 'P3' | 'P4' | 'P6' | 'P10' | 'P15' | 'P20' | 'P30' | 'P40' | 'P50' | 'P60' | 'P70' | 'P80' | null
}

@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 +108,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
type: storage.type
tier: storage.tier
}
dataEncryption: {
type: 'SystemManaged'
}
Expand Down
Loading