Skip to content

Commit

Permalink
feat(azure): adjust SKU and storage for yt01 and prod (#1508)
Browse files Browse the repository at this point in the history
This reverts commit 304f4da.

<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

* The sku and storage now match what Storage has configured their
database with in yt01

## Related Issue(s)

- #N/A Disussed here:
https://digdir.slack.com/archives/C07R312076E/p1732198146365369

## Verification

- [ ] **Your** code builds clean without any errors or warnings
- [ ] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Enhanced PostgreSQL configuration with new storage settings, including
size and auto-grow options.
	- Updated SKU for PostgreSQL resources to a higher capacity version.
- **Bug Fixes**
- Improved flexibility in the PostgreSQL resource setup by allowing
dynamic storage configurations.
- **Documentation**
- Updated parameter definitions to reflect new storage properties and
SKU options.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
arealmaas authored Nov 22, 2024
1 parent 0d4ce7f commit 5478275
Show file tree
Hide file tree
Showing 6 changed files with 49 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
autoGrow: 'Enabled'
tier: 'P15'
type: 'Premium_LRS'
}
enableIndexTuning: false
enableQueryPerformanceInsight: false
}

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'
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

0 comments on commit 5478275

Please sign in to comment.