Bicep 资源定义
可以使用目标操作部署 databaseAccounts/sqlDatabases 资源类型:
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
若要创建 Microsoft.DocumentDB/databaseAccounts/sqlDatabases 资源,请将以下 Bicep 添加到模板。
resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2022-02-15-preview' = {
parent: resourceSymbolicName
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {}
}
}
location: 'string'
name: 'string'
properties: {
options: {
autoscaleSettings: {
maxThroughput: int
}
throughput: int
}
resource: {
id: 'string'
}
}
tags: {
{customized property}: 'string'
}
}
属性值
Microsoft.DocumentDB/databaseAccounts/sqlDatabases
AutoscaleSettings
| 名字 |
描述 |
价值 |
| maxThroughput (最大吞吐量) |
表示最大吞吐量,资源可以纵向扩展。 |
整数 (int) |
Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
CreateUpdateOptionsOrSqlDatabaseGetPropertiesOptions
| 名字 |
描述 |
价值 |
| autoscaleSettings |
指定自动缩放设置。 |
AutoscaleSettings |
| 吞吐量 |
每秒请求单位数。 例如,“throughput”:10000。 |
整数 (int) |
ManagedServiceIdentity
| 名字 |
描述 |
价值 |
| 类型 |
用于资源的标识类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将从服务中删除任何标识。 |
“None” “SystemAssigned” “SystemAssigned,UserAssigned” “UserAssigned” |
| 用户分配的标识 |
与资源关联的用户标识列表。 用户标识字典密钥引用的格式为 ARM 资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 |
ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
SqlDatabaseCreateUpdatePropertiesOrSqlDatabaseGetProperties
SqlDatabaseResourceOrSqlDatabaseGetPropertiesResource
| 名字 |
描述 |
价值 |
| 身份证 |
Cosmos DB SQL 数据库的名称 |
string (必需) |
用法示例
Azure 快速入门示例
以下 Azure 快速入门模板 包含用于部署此资源类型的 Bicep 示例。
ARM 模板资源定义
可以使用目标操作部署 databaseAccounts/sqlDatabases 资源类型:
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
若要创建 Microsoft.DocumentDB/databaseAccounts/sqlDatabases 资源,请将以下 JSON 添加到模板。
{
"type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases",
"apiVersion": "2022-02-15-preview",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
}
}
},
"location": "string",
"properties": {
"options": {
"autoscaleSettings": {
"maxThroughput": "int"
},
"throughput": "int"
},
"resource": {
"id": "string"
}
},
"tags": {
"{customized property}": "string"
}
}
属性值
Microsoft.DocumentDB/databaseAccounts/sqlDatabases
AutoscaleSettings
| 名字 |
描述 |
价值 |
| maxThroughput (最大吞吐量) |
表示最大吞吐量,资源可以纵向扩展。 |
整数 (int) |
Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
CreateUpdateOptionsOrSqlDatabaseGetPropertiesOptions
| 名字 |
描述 |
价值 |
| autoscaleSettings |
指定自动缩放设置。 |
AutoscaleSettings |
| 吞吐量 |
每秒请求单位数。 例如,“throughput”:10000。 |
整数 (int) |
ManagedServiceIdentity
| 名字 |
描述 |
价值 |
| 类型 |
用于资源的标识类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将从服务中删除任何标识。 |
“None” “SystemAssigned” “SystemAssigned,UserAssigned” “UserAssigned” |
| 用户分配的标识 |
与资源关联的用户标识列表。 用户标识字典密钥引用的格式为 ARM 资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 |
ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
SqlDatabaseCreateUpdatePropertiesOrSqlDatabaseGetProperties
SqlDatabaseResourceOrSqlDatabaseGetPropertiesResource
| 名字 |
描述 |
价值 |
| 身份证 |
Cosmos DB SQL 数据库的名称 |
string (必需) |
用法示例
Azure 快速入门模板
以下 Azure 快速入门模板 部署此资源类型。
可以使用目标操作部署 databaseAccounts/sqlDatabases 资源类型:
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
若要创建 Microsoft.DocumentDB/databaseAccounts/sqlDatabases 资源,请将以下 Terraform 添加到模板。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2022-02-15-preview"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
options = {
autoscaleSettings = {
maxThroughput = int
}
throughput = int
}
resource = {
id = "string"
}
}
}
}
属性值
Microsoft.DocumentDB/databaseAccounts/sqlDatabases
AutoscaleSettings
| 名字 |
描述 |
价值 |
| maxThroughput (最大吞吐量) |
表示最大吞吐量,资源可以纵向扩展。 |
整数 (int) |
Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
CreateUpdateOptionsOrSqlDatabaseGetPropertiesOptions
| 名字 |
描述 |
价值 |
| autoscaleSettings |
指定自动缩放设置。 |
AutoscaleSettings |
| 吞吐量 |
每秒请求单位数。 例如,“throughput”:10000。 |
整数 (int) |
ManagedServiceIdentity
| 名字 |
描述 |
价值 |
| 类型 |
用于资源的标识类型。 类型“SystemAssigned,UserAssigned”包括隐式创建的标识和一组用户分配的标识。 类型“None”将从服务中删除任何标识。 |
“None” “SystemAssigned” “SystemAssigned,UserAssigned” “UserAssigned” |
| 用户分配的标识 |
与资源关联的用户标识列表。 用户标识字典密钥引用的格式为 ARM 资源 ID:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}”。 |
ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
SqlDatabaseCreateUpdatePropertiesOrSqlDatabaseGetProperties
SqlDatabaseResourceOrSqlDatabaseGetPropertiesResource
| 名字 |
描述 |
价值 |
| 身份证 |
Cosmos DB SQL 数据库的名称 |
string (必需) |
用法示例
在 Cosmos DB 帐户中部署 SQL 数据库的基本示例。
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"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "databaseAccount" {
type = "Microsoft.DocumentDB/databaseAccounts@2021-10-15"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
kind = "GlobalDocumentDB"
properties = {
capabilities = [
]
consistencyPolicy = {
defaultConsistencyLevel = "BoundedStaleness"
maxIntervalInSeconds = 10
maxStalenessPrefix = 200
}
databaseAccountOfferType = "Standard"
defaultIdentity = "FirstPartyIdentity"
disableKeyBasedMetadataWriteAccess = false
disableLocalAuth = false
enableAnalyticalStorage = false
enableAutomaticFailover = false
enableFreeTier = false
enableMultipleWriteLocations = false
ipRules = [
]
isVirtualNetworkFilterEnabled = false
locations = [
{
failoverPriority = 0
isZoneRedundant = false
locationName = "West Europe"
},
]
networkAclBypass = "None"
networkAclBypassResourceIds = [
]
publicNetworkAccess = "Enabled"
virtualNetworkRules = [
]
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "sqlDatabase" {
type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2021-10-15"
parent_id = azapi_resource.databaseAccount.id
name = var.resource_name
body = {
properties = {
options = {
throughput = 400
}
resource = {
id = var.resource_name
}
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}