通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.DBforPostgreSQL 服务器组v2

Bicep 资源定义

可以使用目标操作部署 serverGroupsv2 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.DBforPostgreSQL/serverGroupsv2 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.DBforPostgreSQL/serverGroupsv2@2023-03-02-preview' = {
  identity: {
    type: 'string'
    userAssignedIdentities: {
      {customized property}: {}
    }
  }
  location: 'string'
  name: 'string'
  properties: {
    administratorLoginPassword: 'string'
    authConfig: {
      activeDirectoryAuth: 'string'
      passwordAuth: 'string'
    }
    citusVersion: 'string'
    coordinatorEnablePublicIpAccess: bool
    coordinatorServerEdition: 'string'
    coordinatorStorageQuotaInMb: int
    coordinatorVCores: int
    databaseName: 'string'
    dataEncryption: {
      primaryKeyUri: 'string'
      primaryUserAssignedIdentityId: 'string'
      type: 'string'
    }
    enableGeoBackup: bool
    enableHa: bool
    enableShardsOnCoordinator: bool
    maintenanceWindow: {
      customWindow: 'string'
      dayOfWeek: int
      startHour: int
      startMinute: int
    }
    nodeCount: int
    nodeEnablePublicIpAccess: bool
    nodeServerEdition: 'string'
    nodeStorageQuotaInMb: int
    nodeVCores: int
    pointInTimeUTC: 'string'
    postgresqlVersion: 'string'
    preferredPrimaryZone: 'string'
    sourceLocation: 'string'
    sourceResourceId: 'string'
  }
  tags: {
    {customized property}: 'string'
  }
}

属性值

Microsoft.DBforPostgreSQL/serverGroupsv2

名字 描述 价值
标识 描述群集的标识。 IdentityProperties
位置 资源所在的地理位置 string (必需)
名字 资源名称 字符串

约束:
最小长度 = 3
最大长度 = 40
模式 = ^(?![0-9]+$)(?!-)[a-z0-9-]{3,40}(?<!-)$ (必需)
性能 群集的属性。 ClusterProperties
标签 资源标记 标记名称和值的字典。 请参阅模板 中的 标记

身份验证配置

名字 描述 价值
activeDirectoryAuth 的 “disabled”
“enabled”
passwordAuth “disabled”
“enabled”

ClusterProperties

名字 描述 价值
administratorLoginPassword 管理员登录名的密码。 创建时需要。 字符串

约束:
敏感值。 以安全参数的形式传入。
authConfig 认证 群集的身份验证配置。 身份验证配置
citusVersion 所有群集服务器上的 Citus 扩展版本。 字符串
coordinatorEnablePublicIpAccess 如果在协调器上启用了公共访问。 布尔
coordinatorServer版本 协调器服务器的版本(默认值:GeneralPurpose)。 创建时需要。 字符串
coordinatorStorageQuotaInMb 服务器的存储(以 MB 为单位)。 创建时需要。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
coordinatorVCores 服务器的 vCore 计数(最大值:96)。 创建时需要。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
数据库名称 群集的数据库名称。 每个群集仅支持一个数据库。 字符串
数据加密 群集的数据加密属性。 数据加密
启用GeoBackup 如果群集备份存储在另一个 Azure 区域中,以及群集区域中存储的备份副本。 仅在创建群集时启用。 布尔
enableHa 如果为群集启用了或未启用高可用性(HA)。 布尔
启用 ShardsOnCoordinator 如果分布式表放置在协调器上,则为未放置。 应在单节点群集上设置为“true”。 更改值后需要分片重新均衡。 布尔
维护窗口 群集的维护时段。 MaintenanceWindow (维护窗口)
nodeCount 节点计数 群集的工作器节点计数。 当节点计数为 0 时,它表示单个节点配置,能够在该节点上创建分布式表。 2 个或更多个工作器节点表示多节点配置。 节点计数值不能为 1。 创建时需要。 整数 (int)
节点启用公共 IpAccess 如果在工作器节点上启用了公共访问。 布尔
nodeServer版本 节点服务器的版本(默认值:MemoryOptimized)。 字符串
节点存储配额InMb 每个工作器节点上的存储(以 MB 为单位)。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
nodeVCore 每个工作器节点上 vCore 中的计算(最大值:104)。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
pointInTimeUTC 群集还原的日期和时间(ISO8601格式)。 字符串
postgresql版本 所有群集服务器上的主要 PostgreSQL 版本。 字符串
首选主区 所有群集服务器的首选主可用性区域 (AZ)。 字符串
sourceLocation 只读副本群集的源群集的 Azure 区域。 字符串
源资源 ID 只读副本群集的源群集的资源 ID。 字符串

数据加密

名字 描述 价值
primaryKeyUri 的 keyvault 中密钥的 URI,用于主服务器的数据加密。 字符串
primaryUserAssignedIdentityId 要用于主服务器数据加密的用户分配标识的资源 ID。 字符串
类型 “AzureKeyVault”
“SystemAssigned”

IdentityProperties

名字 描述 价值
类型 “SystemAssigned”
“UserAssigned”
用户分配的标识 与资源关联的用户分配标识集。 userAssignedIdentities 字典密钥将为 ARM 资源 ID,格式为“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 字典值可以是请求中的空对象({})。 IdentityPropertiesUserAssignedIdentities

IdentityPropertiesUserAssignedIdentities

名字 描述 价值

MaintenanceWindow (维护窗口)

名字 描述 价值
自定义窗口 指示是否启用自定义维护时段。 字符串
dayOfWeek (周) 维护时段的首选一周日期。 整数 (int)
startHour (开始小时) 维护时段在一周的首选日期内的开始时间。 整数 (int)
startMinute (开始分钟) 维护时段的开始时间内的开始时间。 整数 (int)

TrackedResourceTags

名字 描述 价值

UserAssignedIdentity

名字 描述 价值

用法示例

Bicep 示例

部署 Azure Cosmos DB for PostgreSQL 群集的基本示例。

param resourceName string = 'acctest0001'
param location string = 'westeurope'
@secure()
@description('The administrator login password for the PostgreSQL server group')
param administratorLoginPassword string

resource serverGroupsv2 'Microsoft.DBforPostgreSQL/serverGroupsv2@2022-11-08' = {
  name: resourceName
  location: location
  properties: {
    administratorLoginPassword: null
    coordinatorEnablePublicIpAccess: true
    coordinatorServerEdition: 'GeneralPurpose'
    coordinatorStorageQuotaInMb: 131072
    coordinatorVCores: 2
    enableHa: false
    nodeCount: 0
    nodeEnablePublicIpAccess: false
    nodeServerEdition: 'MemoryOptimized'
  }
}

ARM 模板资源定义

可以使用目标操作部署 serverGroupsv2 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.DBforPostgreSQL/serverGroupsv2 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.DBforPostgreSQL/serverGroupsv2",
  "apiVersion": "2023-03-02-preview",
  "name": "string",
  "identity": {
    "type": "string",
    "userAssignedIdentities": {
      "{customized property}": {
      }
    }
  },
  "location": "string",
  "properties": {
    "administratorLoginPassword": "string",
    "authConfig": {
      "activeDirectoryAuth": "string",
      "passwordAuth": "string"
    },
    "citusVersion": "string",
    "coordinatorEnablePublicIpAccess": "bool",
    "coordinatorServerEdition": "string",
    "coordinatorStorageQuotaInMb": "int",
    "coordinatorVCores": "int",
    "databaseName": "string",
    "dataEncryption": {
      "primaryKeyUri": "string",
      "primaryUserAssignedIdentityId": "string",
      "type": "string"
    },
    "enableGeoBackup": "bool",
    "enableHa": "bool",
    "enableShardsOnCoordinator": "bool",
    "maintenanceWindow": {
      "customWindow": "string",
      "dayOfWeek": "int",
      "startHour": "int",
      "startMinute": "int"
    },
    "nodeCount": "int",
    "nodeEnablePublicIpAccess": "bool",
    "nodeServerEdition": "string",
    "nodeStorageQuotaInMb": "int",
    "nodeVCores": "int",
    "pointInTimeUTC": "string",
    "postgresqlVersion": "string",
    "preferredPrimaryZone": "string",
    "sourceLocation": "string",
    "sourceResourceId": "string"
  },
  "tags": {
    "{customized property}": "string"
  }
}

属性值

Microsoft.DBforPostgreSQL/serverGroupsv2

名字 描述 价值
apiVersion API 版本 “2023-03-02-预览”
标识 描述群集的标识。 IdentityProperties
位置 资源所在的地理位置 string (必需)
名字 资源名称 字符串

约束:
最小长度 = 3
最大长度 = 40
模式 = ^(?![0-9]+$)(?!-)[a-z0-9-]{3,40}(?<!-)$ (必需)
性能 群集的属性。 ClusterProperties
标签 资源标记 标记名称和值的字典。 请参阅模板 中的 标记
类型 资源类型 “Microsoft.DBforPostgreSQL/serverGroupsv2”

身份验证配置

名字 描述 价值
activeDirectoryAuth 的 “disabled”
“enabled”
passwordAuth “disabled”
“enabled”

ClusterProperties

名字 描述 价值
administratorLoginPassword 管理员登录名的密码。 创建时需要。 字符串

约束:
敏感值。 以安全参数的形式传入。
authConfig 认证 群集的身份验证配置。 身份验证配置
citusVersion 所有群集服务器上的 Citus 扩展版本。 字符串
coordinatorEnablePublicIpAccess 如果在协调器上启用了公共访问。 布尔
coordinatorServer版本 协调器服务器的版本(默认值:GeneralPurpose)。 创建时需要。 字符串
coordinatorStorageQuotaInMb 服务器的存储(以 MB 为单位)。 创建时需要。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
coordinatorVCores 服务器的 vCore 计数(最大值:96)。 创建时需要。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
数据库名称 群集的数据库名称。 每个群集仅支持一个数据库。 字符串
数据加密 群集的数据加密属性。 数据加密
启用GeoBackup 如果群集备份存储在另一个 Azure 区域中,以及群集区域中存储的备份副本。 仅在创建群集时启用。 布尔
enableHa 如果为群集启用了或未启用高可用性(HA)。 布尔
启用 ShardsOnCoordinator 如果分布式表放置在协调器上,则为未放置。 应在单节点群集上设置为“true”。 更改值后需要分片重新均衡。 布尔
维护窗口 群集的维护时段。 MaintenanceWindow (维护窗口)
nodeCount 节点计数 群集的工作器节点计数。 当节点计数为 0 时,它表示单个节点配置,能够在该节点上创建分布式表。 2 个或更多个工作器节点表示多节点配置。 节点计数值不能为 1。 创建时需要。 整数 (int)
节点启用公共 IpAccess 如果在工作器节点上启用了公共访问。 布尔
nodeServer版本 节点服务器的版本(默认值:MemoryOptimized)。 字符串
节点存储配额InMb 每个工作器节点上的存储(以 MB 为单位)。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
nodeVCore 每个工作器节点上 vCore 中的计算(最大值:104)。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
pointInTimeUTC 群集还原的日期和时间(ISO8601格式)。 字符串
postgresql版本 所有群集服务器上的主要 PostgreSQL 版本。 字符串
首选主区 所有群集服务器的首选主可用性区域 (AZ)。 字符串
sourceLocation 只读副本群集的源群集的 Azure 区域。 字符串
源资源 ID 只读副本群集的源群集的资源 ID。 字符串

数据加密

名字 描述 价值
primaryKeyUri 的 keyvault 中密钥的 URI,用于主服务器的数据加密。 字符串
primaryUserAssignedIdentityId 要用于主服务器数据加密的用户分配标识的资源 ID。 字符串
类型 “AzureKeyVault”
“SystemAssigned”

IdentityProperties

名字 描述 价值
类型 “SystemAssigned”
“UserAssigned”
用户分配的标识 与资源关联的用户分配标识集。 userAssignedIdentities 字典密钥将为 ARM 资源 ID,格式为“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 字典值可以是请求中的空对象({})。 IdentityPropertiesUserAssignedIdentities

IdentityPropertiesUserAssignedIdentities

名字 描述 价值

MaintenanceWindow (维护窗口)

名字 描述 价值
自定义窗口 指示是否启用自定义维护时段。 字符串
dayOfWeek (周) 维护时段的首选一周日期。 整数 (int)
startHour (开始小时) 维护时段在一周的首选日期内的开始时间。 整数 (int)
startMinute (开始分钟) 维护时段的开始时间内的开始时间。 整数 (int)

TrackedResourceTags

名字 描述 价值

UserAssignedIdentity

名字 描述 价值

用法示例

Terraform (AzAPI 提供程序)资源定义

可以使用目标操作部署 serverGroupsv2 资源类型:

  • 资源组

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.DBforPostgreSQL/serverGroupsv2 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DBforPostgreSQL/serverGroupsv2@2023-03-02-preview"
  name = "string"
  parent_id = "string"
  identity {
    type = "string"
    identity_ids = [
      "string"
    ]
  }
  location = "string"
  tags = {
    {customized property} = "string"
  }
  body = {
    properties = {
      administratorLoginPassword = "string"
      authConfig = {
        activeDirectoryAuth = "string"
        passwordAuth = "string"
      }
      citusVersion = "string"
      coordinatorEnablePublicIpAccess = bool
      coordinatorServerEdition = "string"
      coordinatorStorageQuotaInMb = int
      coordinatorVCores = int
      databaseName = "string"
      dataEncryption = {
        primaryKeyUri = "string"
        primaryUserAssignedIdentityId = "string"
        type = "string"
      }
      enableGeoBackup = bool
      enableHa = bool
      enableShardsOnCoordinator = bool
      maintenanceWindow = {
        customWindow = "string"
        dayOfWeek = int
        startHour = int
        startMinute = int
      }
      nodeCount = int
      nodeEnablePublicIpAccess = bool
      nodeServerEdition = "string"
      nodeStorageQuotaInMb = int
      nodeVCores = int
      pointInTimeUTC = "string"
      postgresqlVersion = "string"
      preferredPrimaryZone = "string"
      sourceLocation = "string"
      sourceResourceId = "string"
    }
  }
}

属性值

Microsoft.DBforPostgreSQL/serverGroupsv2

名字 描述 价值
标识 描述群集的标识。 IdentityProperties
位置 资源所在的地理位置 string (必需)
名字 资源名称 字符串

约束:
最小长度 = 3
最大长度 = 40
模式 = ^(?![0-9]+$)(?!-)[a-z0-9-]{3,40}(?<!-)$ (必需)
性能 群集的属性。 ClusterProperties
标签 资源标记 标记名称和值的字典。
类型 资源类型 “Microsoft.DBforPostgreSQL/serverGroupsv2@2023-03-02-preview”

身份验证配置

名字 描述 价值
activeDirectoryAuth 的 “disabled”
“enabled”
passwordAuth “disabled”
“enabled”

ClusterProperties

名字 描述 价值
administratorLoginPassword 管理员登录名的密码。 创建时需要。 字符串

约束:
敏感值。 以安全参数的形式传入。
authConfig 认证 群集的身份验证配置。 身份验证配置
citusVersion 所有群集服务器上的 Citus 扩展版本。 字符串
coordinatorEnablePublicIpAccess 如果在协调器上启用了公共访问。 布尔
coordinatorServer版本 协调器服务器的版本(默认值:GeneralPurpose)。 创建时需要。 字符串
coordinatorStorageQuotaInMb 服务器的存储(以 MB 为单位)。 创建时需要。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
coordinatorVCores 服务器的 vCore 计数(最大值:96)。 创建时需要。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
数据库名称 群集的数据库名称。 每个群集仅支持一个数据库。 字符串
数据加密 群集的数据加密属性。 数据加密
启用GeoBackup 如果群集备份存储在另一个 Azure 区域中,以及群集区域中存储的备份副本。 仅在创建群集时启用。 布尔
enableHa 如果为群集启用了或未启用高可用性(HA)。 布尔
启用 ShardsOnCoordinator 如果分布式表放置在协调器上,则为未放置。 应在单节点群集上设置为“true”。 更改值后需要分片重新均衡。 布尔
维护窗口 群集的维护时段。 MaintenanceWindow (维护窗口)
nodeCount 节点计数 群集的工作器节点计数。 当节点计数为 0 时,它表示单个节点配置,能够在该节点上创建分布式表。 2 个或更多个工作器节点表示多节点配置。 节点计数值不能为 1。 创建时需要。 整数 (int)
节点启用公共 IpAccess 如果在工作器节点上启用了公共访问。 布尔
nodeServer版本 节点服务器的版本(默认值:MemoryOptimized)。 字符串
节点存储配额InMb 每个工作器节点上的存储(以 MB 为单位)。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
nodeVCore 每个工作器节点上 vCore 中的计算(最大值:104)。 有关详细信息,请参阅 /azure/cosmos-db/postgresql/resources-compute。 整数 (int)
pointInTimeUTC 群集还原的日期和时间(ISO8601格式)。 字符串
postgresql版本 所有群集服务器上的主要 PostgreSQL 版本。 字符串
首选主区 所有群集服务器的首选主可用性区域 (AZ)。 字符串
sourceLocation 只读副本群集的源群集的 Azure 区域。 字符串
源资源 ID 只读副本群集的源群集的资源 ID。 字符串

数据加密

名字 描述 价值
primaryKeyUri 的 keyvault 中密钥的 URI,用于主服务器的数据加密。 字符串
primaryUserAssignedIdentityId 要用于主服务器数据加密的用户分配标识的资源 ID。 字符串
类型 “AzureKeyVault”
“SystemAssigned”

IdentityProperties

名字 描述 价值
类型 “SystemAssigned”
“UserAssigned”
用户分配的标识 与资源关联的用户分配标识集。 userAssignedIdentities 字典密钥将为 ARM 资源 ID,格式为“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 字典值可以是请求中的空对象({})。 IdentityPropertiesUserAssignedIdentities

IdentityPropertiesUserAssignedIdentities

名字 描述 价值

MaintenanceWindow (维护窗口)

名字 描述 价值
自定义窗口 指示是否启用自定义维护时段。 字符串
dayOfWeek (周) 维护时段的首选一周日期。 整数 (int)
startHour (开始小时) 维护时段在一周的首选日期内的开始时间。 整数 (int)
startMinute (开始分钟) 维护时段的开始时间内的开始时间。 整数 (int)

TrackedResourceTags

名字 描述 价值

UserAssignedIdentity

名字 描述 价值

用法示例

Terraform 示例

部署 Azure Cosmos DB for PostgreSQL 群集的基本示例。

terraform {
  required_providers {
    azapi = {
      source = "Azure/azapi"
    }
  }
}

provider "azapi" {
  skip_provider_registration = false
}

variable "resource_name" {
  type    = string
  default = "acctest0001"
}

variable "location" {
  type    = string
  default = "westeurope"
}

variable "administrator_login_password" {
  type        = string
  description = "The administrator login password for the PostgreSQL server group"
  sensitive   = true
}

resource "azapi_resource" "resourceGroup" {
  type     = "Microsoft.Resources/resourceGroups@2020-06-01"
  name     = var.resource_name
  location = var.location
}

resource "azapi_resource" "serverGroupsv2" {
  type      = "Microsoft.DBforPostgreSQL/serverGroupsv2@2022-11-08"
  parent_id = azapi_resource.resourceGroup.id
  name      = var.resource_name
  location  = var.location
  body = {
    properties = {
      administratorLoginPassword      = var.administrator_login_password
      coordinatorEnablePublicIpAccess = true
      coordinatorServerEdition        = "GeneralPurpose"
      coordinatorStorageQuotaInMb     = 131072
      coordinatorVCores               = 2
      enableHa                        = false
      nodeCount                       = 0
      nodeEnablePublicIpAccess        = false
      nodeServerEdition               = "MemoryOptimized"
    }
  }
  schema_validation_enabled = false
  response_export_values    = ["*"]
}