Код IT
← Каталог

Инфраструктура как код (Infrastructure as Code) — Azure Bicep

Фрагмент из «Инфраструктура как код (Infrastructure as Code)»: Azure Bicep.

text infra-securityencyclopedia8-04-devops-ci-cd-215 embed URL статья в энциклопедии
Plain text main.txt
param location string = resourceGroup().location
param serverName string
param administratorLogin string
param administratorLoginPassword securestring

resource postgresServer 'Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01' = {
  name: serverName
  location: location
  sku: {
    name: 'Standard_B1ms'
    tier: 'Burstable'
  }
  properties: {
    version: '15'
    administratorLogin: administratorLogin
    administratorLoginPassword: administratorLoginPassword
    storage: {
      storageSizeGB: 32
    }
    network: {
      publicNetworkAccess: 'Disabled'
      delegatedSubnetResourceId: resourceId('Microsoft.Network/virtualNetworks/subnets', 'vnet-main', 'subnet-db')
    }
  }
}

output serverFqdn string = postgresServer.properties.fullyQualifiedDomainName
param location string = resourceGroup().location
param serverName string
param administratorLogin string
param administratorLoginPassword securestring

resource postgresServer 'Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01' = {
  name: serverName
  location: location
  sku: {
    name: 'Standard_B1ms'
    tier: 'Burstable'
  }
  properties: {
    version: '15'
    administratorLogin: administratorLogin
    administratorLoginPassword: administratorLoginPassword
    storage: {
      storageSizeGB: 32
    }
    network: {
      publicNetworkAccess: 'Disabled'
      delegatedSubnetResourceId: resourceId('Microsoft.Network/virtualNetworks/subnets', 'vnet-main', 'subnet-db')
    }
  }
}

output serverFqdn string = postgresServer.properties.fullyQualifiedDomainName