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

fix(infra): ensure we set az for primary in postgresql #1973

Merged
merged 4 commits into from
Feb 27, 2025
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
2 changes: 2 additions & 0 deletions .azure/infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ param postgresConfiguration {
enableQueryPerformanceInsight: bool
enableHighAvailability: bool
backupRetentionDays: int
availabilityZone: string
}

import { Sku as ServiceBusSku } from '../modules/serviceBus/main.bicep'
Expand Down Expand Up @@ -218,6 +219,7 @@ module postgresql '../modules/postgreSql/create.bicep' = {
vnetId: vnet.outputs.virtualNetworkId
enableHighAvailability: postgresConfiguration.enableHighAvailability
backupRetentionDays: postgresConfiguration.backupRetentionDays
availabilityZone: postgresConfiguration.availabilityZone
tags: tags
}
}
Expand Down
1 change: 1 addition & 0 deletions .azure/infrastructure/prod.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ param postgresConfiguration = {
enableQueryPerformanceInsight: false
enableHighAvailability: true
backupRetentionDays: 32
availabilityZone: '3'
}

param redisSku = {
Expand Down
1 change: 1 addition & 0 deletions .azure/infrastructure/staging.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ param postgresConfiguration = {
enableQueryPerformanceInsight: true
enableHighAvailability: false
backupRetentionDays: 7
availabilityZone: '2'
}

param redisSku = {
Expand Down
1 change: 1 addition & 0 deletions .azure/infrastructure/test.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ param postgresConfiguration = {
enableQueryPerformanceInsight: true
enableHighAvailability: false
backupRetentionDays: 7
availabilityZone: '1'
}

param redisSku = {
Expand Down
1 change: 1 addition & 0 deletions .azure/infrastructure/yt01.bicepparam
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ param postgresConfiguration = {
enableQueryPerformanceInsight: true
enableHighAvailability: false
backupRetentionDays: 7
availabilityZone: '1'
}

param redisSku = {
Expand Down
4 changes: 4 additions & 0 deletions .azure/modules/postgreSql/create.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ param appInsightWorkspaceName string
@description('Enable high availability')
param enableHighAvailability bool

@description('The availability zone for the PostgreSQL primary server')
param availabilityZone string

@description('The number of days to retain backups. If not specified, the default value of 7 days will be used.')
@minValue(7)
@maxValue(35)
Expand Down Expand Up @@ -123,6 +126,7 @@ resource postgres 'Microsoft.DBforPostgreSQL/flexibleServers@2024-08-01' = {
delegatedSubnetResourceId: subnetId
privateDnsZoneArmResourceId: privateDnsZone.outputs.id
}
availabilityZone: availabilityZone
highAvailability: highAvailabilityConfig
}
sku: sku
Expand Down
Loading