你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Bicep 资源定义
可以使用目标操作部署 flexibleServers 资源类型:
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.DBforPostgreSQL/flexibleServers 资源,请将以下 Bicep 添加到模板。
resource symbolicname 'Microsoft.DBforPostgreSQL/flexibleServers@2022-03-08-preview' = {
scope: resourceSymbolicName or scope
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {
clientId: 'string'
principalId: 'string'
}
}
}
location: 'string'
name: 'string'
properties: {
administratorLogin: 'string'
administratorLoginPassword: 'string'
authConfig: {
activeDirectoryAuthEnabled: bool
passwordAuthEnabled: bool
tenantId: 'string'
}
availabilityZone: 'string'
backup: {
backupRetentionDays: int
geoRedundantBackup: 'string'
}
createMode: 'string'
dataEncryption: {
primaryKeyURI: 'string'
primaryUserAssignedIdentityId: 'string'
type: 'string'
}
highAvailability: {
mode: 'string'
standbyAvailabilityZone: 'string'
}
maintenanceWindow: {
customWindow: 'string'
dayOfWeek: int
startHour: int
startMinute: int
}
network: {
delegatedSubnetResourceId: 'string'
privateDnsZoneArmResourceId: 'string'
}
pointInTimeUTC: 'string'
replicaCapacity: int
replicationRole: 'string'
sourceServerResourceId: 'string'
storage: {
storageSizeGB: int
}
version: 'string'
}
sku: {
name: 'string'
tier: 'string'
}
tags: {
{customized property}: 'string'
}
}
属性值
Microsoft.DBforPostgreSQL/flexibleServers
| 名字 | 描述 | 价值 |
|---|---|---|
| 标识 | 描述应用程序的标识。 | UserAssignedIdentity |
| 位置 | 资源所在的地理位置 | string (必需) |
| 名字 | 资源名称 | 字符串 约束: 最小长度 = 3 最大长度 = 63 模式 = ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)* (必需) |
| 性能 | 服务器的属性。 | ServerProperties |
| 作用域 | 在与部署范围不同的范围内创建资源时使用。 | 将此属性设置为资源的符号名称以应用 扩展资源。 |
| SKU | 服务器的 SKU(定价层)。 | SKU |
| 标签 | 资源标记 | 标记名称和值的字典。 请参阅模板 中的 |
身份验证配置
| 名字 | 描述 | 价值 |
|---|---|---|
| activeDirectoryAuth已启用 | 如果为 true,则启用 Azure Active Directory 身份验证。 | 布尔 |
| 密码身份验证已启用 | 如果为 true,则启用密码身份验证。 | 布尔 |
| 租户ID | 服务器的租户 ID。 | 字符串 |
备份
| 名字 | 描述 | 价值 |
|---|---|---|
| backupRetentionDays 备份 | 服务器的备份保留日。 | 整数 (int) |
| geoRedundantBackup | 一个值,该值指示是否在服务器上启用 Geo-Redundant 备份。 | “Disabled” “Enabled” |
数据加密
| 名字 | 描述 | 价值 |
|---|---|---|
| primaryKeyURI 的 | 主服务器数据加密密钥的 URI。 | 字符串 |
| primaryUserAssignedIdentityId | 要用于主服务器数据加密的用户分配标识的资源 ID。 | 字符串 |
| 类型 | 用于描述是否为系统分配的数据加密类型与 Azure Key Vault。 | “AzureKeyVault” “SystemAssigned” |
高可用性
| 名字 | 描述 | 价值 |
|---|---|---|
| 模式 | 服务器的 HA 模式。 | “Disabled” “SameZone” “ZoneRedundant” |
| standbyAvailabilityZone | 备用服务器的可用性区域信息。 | 字符串 |
MaintenanceWindow (维护窗口)
| 名字 | 描述 | 价值 |
|---|---|---|
| 自定义窗口 | 指示是启用还是禁用自定义窗口 | 字符串 |
| dayOfWeek (周) | 维护时段的星期几 | 整数 (int) |
| startHour (开始小时) | 维护时段的开始时间 | 整数 (int) |
| startMinute (开始分钟) | 维护时段的开始时间 | 整数 (int) |
网络
| 名字 | 描述 | 价值 |
|---|---|---|
| delegatedSubnetResourceId | 委托的子网 arm 资源 ID。 | 字符串 |
| privateDnsZoneArmResourceId | 专用 dns 区域 arm 资源 ID。 | 字符串 |
ServerProperties
| 名字 | 描述 | 价值 |
|---|---|---|
| 管理员登录 | 管理员的服务器登录名。 只能在创建服务器时指定(并且是创建所必需的)。 | 字符串 |
| administratorLoginPassword | 管理员登录密码(创建服务器时需要)。 | 字符串 约束: 敏感值。 以安全参数的形式传入。 |
| authConfig 认证 | 服务器的 AuthConfig 属性。 | 身份验证配置 |
| 可用性区域 | 服务器的可用性区域信息。 | 字符串 |
| 备份 | 服务器的备份属性。 | 备份 |
| createMode | 创建新的 PostgreSQL 服务器的模式。 | “Create” “Default” “GeoRestore” “PointInTimeRestore” “Replica” “Update” |
| 数据加密 | 服务器的数据加密属性。 | 数据加密 |
| 高可用性 | 服务器的高可用性属性。 | 高可用性 |
| 维护窗口 | 服务器的维护时段属性。 | MaintenanceWindow (维护窗口) |
| 网络 | 服务器的网络属性。 | 网络 |
| pointInTimeUTC | 还原点创建时间(ISO8601格式),指定要从中还原的时间。 当“createMode”为“PointInTimeRestore”或“GeoRestore”时,它是必需的。 | 字符串 |
| replicaCapacity | 服务器允许的副本。 | 整数 (int) |
| replicationRole | 服务器的复制角色 | “AsyncReplica” “GeoAsyncReplica” “None” “Primary” |
| sourceServerResourceId | 要从中还原的源服务器资源 ID。 当“createMode”为“PointInTimeRestore”或“GeoRestore”或“Replica”时,它是必需的。 | 字符串 |
| 存储 | 服务器的存储属性。 | 存储 |
| 版本 | PostgreSQL 服务器版本。 | '11' '12' '13' '14' |
SKU
| 名字 | 描述 | 价值 |
|---|---|---|
| 名字 | SKU 的名称,通常为层 + 系列 + 核心,例如Standard_D4s_v3。 | string (必需) |
| 分层 | 特定 SKU 的层,例如可突发。 | “可突发” “GeneralPurpose” “MemoryOptimized”(必需) |
存储
| 名字 | 描述 | 价值 |
|---|---|---|
| 存储大小GB | 服务器允许的最大存储。 | 整数 (int) |
TrackedResourceTags
| 名字 | 描述 | 价值 |
|---|
UserAssignedIdentity
| 名字 | 描述 | 价值 |
|---|---|---|
| 类型 | 与此资源关联的标识类型;当前限制为“SystemAssigned 和 UserAssigned” | “None” “SystemAssigned” “UserAssigned”(必需) |
| 用户分配的标识 | 表示用户分配的标识映射。 | UserAssignedIdentityMap |
UserAssignedIdentityMap
| 名字 | 描述 | 价值 |
|---|
用户身份
| 名字 | 描述 | 价值 |
|---|---|---|
| 客户端 ID | 此标识表示的服务主体的客户端标识符。 | 字符串 |
| principalId (主体ID) | 此标识表示的服务主体的对象标识符。 | 字符串 |
用法示例
Azure 验证模块
以下 Azure 验证模块 可用于部署此资源类型。
| 模块 | 描述 |
|---|---|
| DB for Postgre SQL 灵活服务器 | 用于 Postgre SQL 灵活服务器的 DB 的 AVM 资源模块 |
Azure 快速入门示例
以下 Azure 快速入门模板 包含用于部署此资源类型的 Bicep 示例。
| Bicep 文件 | 描述 |
|---|---|
| 创建 PgFlex 服务器 & 通过备份保管库 启用保护 | 创建 PostgreSQL 灵活服务器的模板,并通过备份保管库启用保护 |
| 使用 AAD 部署 Azure Database for PostgreSQL(灵活) |
此模板提供了部署灵活服务器 Azure Database for PostgreSQL 和 AAD 集成的方法。 |
| 使用 VNet 部署 Azure Database for PostgreSQL (灵活) | 此模板提供了部署灵活服务器 Azure Database for PostgreSQL 和 VNet 集成的方法。 |
| 使用 PostgreSQL 和 VNet 集成的 Web 应用 SonarQube | 此模板提供使用 PostgreSQL 灵活服务器、VNet 集成和专用 DNS 轻松将 SonarQube 部署到 Linux 上的 Web 应用。 |
ARM 模板资源定义
可以使用目标操作部署 flexibleServers 资源类型:
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.DBforPostgreSQL/flexibleServers 资源,请将以下 JSON 添加到模板。
{
"type": "Microsoft.DBforPostgreSQL/flexibleServers",
"apiVersion": "2022-03-08-preview",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
"clientId": "string",
"principalId": "string"
}
}
},
"location": "string",
"properties": {
"administratorLogin": "string",
"administratorLoginPassword": "string",
"authConfig": {
"activeDirectoryAuthEnabled": "bool",
"passwordAuthEnabled": "bool",
"tenantId": "string"
},
"availabilityZone": "string",
"backup": {
"backupRetentionDays": "int",
"geoRedundantBackup": "string"
},
"createMode": "string",
"dataEncryption": {
"primaryKeyURI": "string",
"primaryUserAssignedIdentityId": "string",
"type": "string"
},
"highAvailability": {
"mode": "string",
"standbyAvailabilityZone": "string"
},
"maintenanceWindow": {
"customWindow": "string",
"dayOfWeek": "int",
"startHour": "int",
"startMinute": "int"
},
"network": {
"delegatedSubnetResourceId": "string",
"privateDnsZoneArmResourceId": "string"
},
"pointInTimeUTC": "string",
"replicaCapacity": "int",
"replicationRole": "string",
"sourceServerResourceId": "string",
"storage": {
"storageSizeGB": "int"
},
"version": "string"
},
"sku": {
"name": "string",
"tier": "string"
},
"tags": {
"{customized property}": "string"
}
}
属性值
Microsoft.DBforPostgreSQL/flexibleServers
| 名字 | 描述 | 价值 |
|---|---|---|
| apiVersion | API 版本 | “2022-03-08-预览” |
| 标识 | 描述应用程序的标识。 | UserAssignedIdentity |
| 位置 | 资源所在的地理位置 | string (必需) |
| 名字 | 资源名称 | 字符串 约束: 最小长度 = 3 最大长度 = 63 模式 = ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)* (必需) |
| 性能 | 服务器的属性。 | ServerProperties |
| SKU | 服务器的 SKU(定价层)。 | SKU |
| 标签 | 资源标记 | 标记名称和值的字典。 请参阅模板 中的 |
| 类型 | 资源类型 | “Microsoft.DBforPostgreSQL/flexibleServers” |
身份验证配置
| 名字 | 描述 | 价值 |
|---|---|---|
| activeDirectoryAuth已启用 | 如果为 true,则启用 Azure Active Directory 身份验证。 | 布尔 |
| 密码身份验证已启用 | 如果为 true,则启用密码身份验证。 | 布尔 |
| 租户ID | 服务器的租户 ID。 | 字符串 |
备份
| 名字 | 描述 | 价值 |
|---|---|---|
| backupRetentionDays 备份 | 服务器的备份保留日。 | 整数 (int) |
| geoRedundantBackup | 一个值,该值指示是否在服务器上启用 Geo-Redundant 备份。 | “Disabled” “Enabled” |
数据加密
| 名字 | 描述 | 价值 |
|---|---|---|
| primaryKeyURI 的 | 主服务器数据加密密钥的 URI。 | 字符串 |
| primaryUserAssignedIdentityId | 要用于主服务器数据加密的用户分配标识的资源 ID。 | 字符串 |
| 类型 | 用于描述是否为系统分配的数据加密类型与 Azure Key Vault。 | “AzureKeyVault” “SystemAssigned” |
高可用性
| 名字 | 描述 | 价值 |
|---|---|---|
| 模式 | 服务器的 HA 模式。 | “Disabled” “SameZone” “ZoneRedundant” |
| standbyAvailabilityZone | 备用服务器的可用性区域信息。 | 字符串 |
MaintenanceWindow (维护窗口)
| 名字 | 描述 | 价值 |
|---|---|---|
| 自定义窗口 | 指示是启用还是禁用自定义窗口 | 字符串 |
| dayOfWeek (周) | 维护时段的星期几 | 整数 (int) |
| startHour (开始小时) | 维护时段的开始时间 | 整数 (int) |
| startMinute (开始分钟) | 维护时段的开始时间 | 整数 (int) |
网络
| 名字 | 描述 | 价值 |
|---|---|---|
| delegatedSubnetResourceId | 委托的子网 arm 资源 ID。 | 字符串 |
| privateDnsZoneArmResourceId | 专用 dns 区域 arm 资源 ID。 | 字符串 |
ServerProperties
| 名字 | 描述 | 价值 |
|---|---|---|
| 管理员登录 | 管理员的服务器登录名。 只能在创建服务器时指定(并且是创建所必需的)。 | 字符串 |
| administratorLoginPassword | 管理员登录密码(创建服务器时需要)。 | 字符串 约束: 敏感值。 以安全参数的形式传入。 |
| authConfig 认证 | 服务器的 AuthConfig 属性。 | 身份验证配置 |
| 可用性区域 | 服务器的可用性区域信息。 | 字符串 |
| 备份 | 服务器的备份属性。 | 备份 |
| createMode | 创建新的 PostgreSQL 服务器的模式。 | “Create” “Default” “GeoRestore” “PointInTimeRestore” “Replica” “Update” |
| 数据加密 | 服务器的数据加密属性。 | 数据加密 |
| 高可用性 | 服务器的高可用性属性。 | 高可用性 |
| 维护窗口 | 服务器的维护时段属性。 | MaintenanceWindow (维护窗口) |
| 网络 | 服务器的网络属性。 | 网络 |
| pointInTimeUTC | 还原点创建时间(ISO8601格式),指定要从中还原的时间。 当“createMode”为“PointInTimeRestore”或“GeoRestore”时,它是必需的。 | 字符串 |
| replicaCapacity | 服务器允许的副本。 | 整数 (int) |
| replicationRole | 服务器的复制角色 | “AsyncReplica” “GeoAsyncReplica” “None” “Primary” |
| sourceServerResourceId | 要从中还原的源服务器资源 ID。 当“createMode”为“PointInTimeRestore”或“GeoRestore”或“Replica”时,它是必需的。 | 字符串 |
| 存储 | 服务器的存储属性。 | 存储 |
| 版本 | PostgreSQL 服务器版本。 | '11' '12' '13' '14' |
SKU
| 名字 | 描述 | 价值 |
|---|---|---|
| 名字 | SKU 的名称,通常为层 + 系列 + 核心,例如Standard_D4s_v3。 | string (必需) |
| 分层 | 特定 SKU 的层,例如可突发。 | “可突发” “GeneralPurpose” “MemoryOptimized”(必需) |
存储
| 名字 | 描述 | 价值 |
|---|---|---|
| 存储大小GB | 服务器允许的最大存储。 | 整数 (int) |
TrackedResourceTags
| 名字 | 描述 | 价值 |
|---|
UserAssignedIdentity
| 名字 | 描述 | 价值 |
|---|---|---|
| 类型 | 与此资源关联的标识类型;当前限制为“SystemAssigned 和 UserAssigned” | “None” “SystemAssigned” “UserAssigned”(必需) |
| 用户分配的标识 | 表示用户分配的标识映射。 | UserAssignedIdentityMap |
UserAssignedIdentityMap
| 名字 | 描述 | 价值 |
|---|
用户身份
| 名字 | 描述 | 价值 |
|---|---|---|
| 客户端 ID | 此标识表示的服务主体的客户端标识符。 | 字符串 |
| principalId (主体ID) | 此标识表示的服务主体的对象标识符。 | 字符串 |
用法示例
Azure 快速入门模板
以下 Azure 快速入门模板 部署此资源类型。
| 模板 | 描述 |
|---|---|
|
创建 PgFlex 服务器 & 通过备份保管库 启用保护 |
创建 PostgreSQL 灵活服务器的模板,并通过备份保管库启用保护 |
| 使用 AAD 部署 Azure Database for PostgreSQL(灵活) |
此模板提供了部署灵活服务器 Azure Database for PostgreSQL 和 AAD 集成的方法。 |
|
使用 VNet 部署 Azure Database for PostgreSQL (灵活) |
此模板提供了部署灵活服务器 Azure Database for PostgreSQL 和 VNet 集成的方法。 |
| 使用 PostgreSQL 和 VNet 集成的 Web 应用 SonarQube |
此模板提供使用 PostgreSQL 灵活服务器、VNet 集成和专用 DNS 轻松将 SonarQube 部署到 Linux 上的 Web 应用。 |
Terraform (AzAPI 提供程序)资源定义
可以使用目标操作部署 flexibleServers 资源类型:
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.DBforPostgreSQL/flexibleServers 资源,请将以下 Terraform 添加到模板。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DBforPostgreSQL/flexibleServers@2022-03-08-preview"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
administratorLogin = "string"
administratorLoginPassword = "string"
authConfig = {
activeDirectoryAuthEnabled = bool
passwordAuthEnabled = bool
tenantId = "string"
}
availabilityZone = "string"
backup = {
backupRetentionDays = int
geoRedundantBackup = "string"
}
createMode = "string"
dataEncryption = {
primaryKeyURI = "string"
primaryUserAssignedIdentityId = "string"
type = "string"
}
highAvailability = {
mode = "string"
standbyAvailabilityZone = "string"
}
maintenanceWindow = {
customWindow = "string"
dayOfWeek = int
startHour = int
startMinute = int
}
network = {
delegatedSubnetResourceId = "string"
privateDnsZoneArmResourceId = "string"
}
pointInTimeUTC = "string"
replicaCapacity = int
replicationRole = "string"
sourceServerResourceId = "string"
storage = {
storageSizeGB = int
}
version = "string"
}
sku = {
name = "string"
tier = "string"
}
}
}
属性值
Microsoft.DBforPostgreSQL/flexibleServers
| 名字 | 描述 | 价值 |
|---|---|---|
| 标识 | 描述应用程序的标识。 | UserAssignedIdentity |
| 位置 | 资源所在的地理位置 | string (必需) |
| 名字 | 资源名称 | 字符串 约束: 最小长度 = 3 最大长度 = 63 模式 = ^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)* (必需) |
| parent_id | 要向其应用此扩展资源的资源的 ID。 | string (必需) |
| 性能 | 服务器的属性。 | ServerProperties |
| SKU | 服务器的 SKU(定价层)。 | SKU |
| 标签 | 资源标记 | 标记名称和值的字典。 |
| 类型 | 资源类型 | “Microsoft.DBforPostgreSQL/flexibleServers@2022-03-08-preview” |
身份验证配置
| 名字 | 描述 | 价值 |
|---|---|---|
| activeDirectoryAuth已启用 | 如果为 true,则启用 Azure Active Directory 身份验证。 | 布尔 |
| 密码身份验证已启用 | 如果为 true,则启用密码身份验证。 | 布尔 |
| 租户ID | 服务器的租户 ID。 | 字符串 |
备份
| 名字 | 描述 | 价值 |
|---|---|---|
| backupRetentionDays 备份 | 服务器的备份保留日。 | 整数 (int) |
| geoRedundantBackup | 一个值,该值指示是否在服务器上启用 Geo-Redundant 备份。 | “Disabled” “Enabled” |
数据加密
| 名字 | 描述 | 价值 |
|---|---|---|
| primaryKeyURI 的 | 主服务器数据加密密钥的 URI。 | 字符串 |
| primaryUserAssignedIdentityId | 要用于主服务器数据加密的用户分配标识的资源 ID。 | 字符串 |
| 类型 | 用于描述是否为系统分配的数据加密类型与 Azure Key Vault。 | “AzureKeyVault” “SystemAssigned” |
高可用性
| 名字 | 描述 | 价值 |
|---|---|---|
| 模式 | 服务器的 HA 模式。 | “Disabled” “SameZone” “ZoneRedundant” |
| standbyAvailabilityZone | 备用服务器的可用性区域信息。 | 字符串 |
MaintenanceWindow (维护窗口)
| 名字 | 描述 | 价值 |
|---|---|---|
| 自定义窗口 | 指示是启用还是禁用自定义窗口 | 字符串 |
| dayOfWeek (周) | 维护时段的星期几 | 整数 (int) |
| startHour (开始小时) | 维护时段的开始时间 | 整数 (int) |
| startMinute (开始分钟) | 维护时段的开始时间 | 整数 (int) |
网络
| 名字 | 描述 | 价值 |
|---|---|---|
| delegatedSubnetResourceId | 委托的子网 arm 资源 ID。 | 字符串 |
| privateDnsZoneArmResourceId | 专用 dns 区域 arm 资源 ID。 | 字符串 |
ServerProperties
| 名字 | 描述 | 价值 |
|---|---|---|
| 管理员登录 | 管理员的服务器登录名。 只能在创建服务器时指定(并且是创建所必需的)。 | 字符串 |
| administratorLoginPassword | 管理员登录密码(创建服务器时需要)。 | 字符串 约束: 敏感值。 以安全参数的形式传入。 |
| authConfig 认证 | 服务器的 AuthConfig 属性。 | 身份验证配置 |
| 可用性区域 | 服务器的可用性区域信息。 | 字符串 |
| 备份 | 服务器的备份属性。 | 备份 |
| createMode | 创建新的 PostgreSQL 服务器的模式。 | “Create” “Default” “GeoRestore” “PointInTimeRestore” “Replica” “Update” |
| 数据加密 | 服务器的数据加密属性。 | 数据加密 |
| 高可用性 | 服务器的高可用性属性。 | 高可用性 |
| 维护窗口 | 服务器的维护时段属性。 | MaintenanceWindow (维护窗口) |
| 网络 | 服务器的网络属性。 | 网络 |
| pointInTimeUTC | 还原点创建时间(ISO8601格式),指定要从中还原的时间。 当“createMode”为“PointInTimeRestore”或“GeoRestore”时,它是必需的。 | 字符串 |
| replicaCapacity | 服务器允许的副本。 | 整数 (int) |
| replicationRole | 服务器的复制角色 | “AsyncReplica” “GeoAsyncReplica” “None” “Primary” |
| sourceServerResourceId | 要从中还原的源服务器资源 ID。 当“createMode”为“PointInTimeRestore”或“GeoRestore”或“Replica”时,它是必需的。 | 字符串 |
| 存储 | 服务器的存储属性。 | 存储 |
| 版本 | PostgreSQL 服务器版本。 | '11' '12' '13' '14' |
SKU
| 名字 | 描述 | 价值 |
|---|---|---|
| 名字 | SKU 的名称,通常为层 + 系列 + 核心,例如Standard_D4s_v3。 | string (必需) |
| 分层 | 特定 SKU 的层,例如可突发。 | “可突发” “GeneralPurpose” “MemoryOptimized”(必需) |
存储
| 名字 | 描述 | 价值 |
|---|---|---|
| 存储大小GB | 服务器允许的最大存储。 | 整数 (int) |
TrackedResourceTags
| 名字 | 描述 | 价值 |
|---|
UserAssignedIdentity
| 名字 | 描述 | 价值 |
|---|---|---|
| 类型 | 与此资源关联的标识类型;当前限制为“SystemAssigned 和 UserAssigned” | “None” “SystemAssigned” “UserAssigned”(必需) |
| 用户分配的标识 | 表示用户分配的标识映射。 | UserAssignedIdentityMap |
UserAssignedIdentityMap
| 名字 | 描述 | 价值 |
|---|
用户身份
| 名字 | 描述 | 价值 |
|---|---|---|
| 客户端 ID | 此标识表示的服务主体的客户端标识符。 | 字符串 |
| principalId (主体ID) | 此标识表示的服务主体的对象标识符。 | 字符串 |
用法示例
Terraform 示例
部署 PostgreSQL 灵活服务器的基本示例。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
azurerm = {
source = "hashicorp/azurerm"
}
}
}
provider "azurerm" {
features {
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "eastus"
}
variable "administrator_login" {
type = string
description = "The administrator login name for the PostgreSQL flexible server"
}
variable "administrator_login_password" {
type = string
description = "The administrator login password for the PostgreSQL flexible server"
sensitive = true
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "flexibleServer" {
type = "Microsoft.DBforPostgreSQL/flexibleServers@2023-06-01-preview"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
identity = {
type = "None",
userAssignedIdentities = null
},
properties = {
administratorLogin = var.administrator_login
administratorLoginPassword = var.administrator_login_password
availabilityZone = "2"
backup = {
geoRedundantBackup = "Disabled"
}
highAvailability = {
mode = "Disabled"
}
network = {
}
storage = {
storageSizeGB = 32
}
version = "12"
}
sku = {
name = "Standard_D2s_v3"
tier = "GeneralPurpose"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
Azure 验证模块
以下 Azure 验证模块 可用于部署此资源类型。
| 模块 | 描述 |
|---|---|
| DB for Postgre SQL 灵活服务器 | 用于 Postgre SQL 灵活服务器的 DB 的 AVM 资源模块 |