Skip to content

Instantly share code, notes, and snippets.

@apc-kamezaki
Created April 5, 2021 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apc-kamezaki/3a6d6b3ca6de61bfaeb87d10bb720c38 to your computer and use it in GitHub Desktop.
Save apc-kamezaki/3a6d6b3ca6de61bfaeb87d10bb720c38 to your computer and use it in GitHub Desktop.
入門Azure Bicep
@description('Name for postgreSQL')
param name string
@description('resource location')
param location string = resourceGroup().location
@description('Administrator user name')
@secure()
param adminUser string
@description('Administrator user password')
@secure()
param adminPassword string
@description('SKU tier')
@allowed([
'Basic'
'GeneralPurpose'
'MemoryOptimized'
])
param skuTier string = 'Basic'
@description('The family of hardware')
param skuFamily string = 'Gen5'
@description('The scale up/out capacity')
param skuCapacity int = skuTier == 'Basic' ? 2 : 4
var skuNamePrefix = skuTier == 'GeneralPurpose' ? 'GP' : (skuTier == 'Basic' ? 'B' : 'OM')
var skuName = '${skuNamePrefix}_${skuFamily}_${skuCapacity}'
resource pgsql 'Microsoft.DBForPostgreSQL/servers@2017-12-01' = {
name: name
location: location
sku: {
name: skuName
tier: skuTier
family: skuFamily
capacity: skuCapacity
}
properties: {
createMode: 'Default'
administratorLogin: adminUser
administratorLoginPassword: adminPassword
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment