Bicep 資源定義
databaseAccounts/sqlDatabases 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
若要建立 Microsoft.DocumentDB/databaseAccounts/sqlDatabases 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2020-06-01-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 |
| 輸送量 |
每秒要求單位數。 例如,「輸送量」:10000。 |
整數 (int) |
ManagedServiceIdentity
| 名字 |
描述 |
價值 |
| 型別 |
用於資源的身分識別類型。 類型 'SystemAssigned,UserAssigned' 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 會從服務中移除任何身分識別。 |
“無” “系統分配” 'SystemAssigned,UserAssigned' 'UserAssigned' |
| 使用者指派的身份 |
與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 |
ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
SqlDatabaseCreateUpdatePropertiesOrSqlDatabaseGetProperties
SqlDatabaseResourceOrSqlDatabaseGetPropertiesResource
| 名字 |
描述 |
價值 |
| 識別碼 |
Cosmos DB SQL 資料庫的名稱 |
字串 (必要) |
使用範例
Azure 快速入門範例
下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。
ARM 樣本資源定義
databaseAccounts/sqlDatabases 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
若要建立 Microsoft.DocumentDB/databaseAccounts/sqlDatabases 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.DocumentDB/databaseAccounts/sqlDatabases",
"apiVersion": "2020-06-01-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 |
| 輸送量 |
每秒要求單位數。 例如,「輸送量」:10000。 |
整數 (int) |
ManagedServiceIdentity
| 名字 |
描述 |
價值 |
| 型別 |
用於資源的身分識別類型。 類型 'SystemAssigned,UserAssigned' 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 會從服務中移除任何身分識別。 |
“無” “系統分配” 'SystemAssigned,UserAssigned' 'UserAssigned' |
| 使用者指派的身份 |
與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 |
ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
SqlDatabaseCreateUpdatePropertiesOrSqlDatabaseGetProperties
SqlDatabaseResourceOrSqlDatabaseGetPropertiesResource
| 名字 |
描述 |
價值 |
| 識別碼 |
Cosmos DB SQL 資料庫的名稱 |
字串 (必要) |
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
databaseAccounts/sqlDatabases 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
若要建立 Microsoft.DocumentDB/databaseAccounts/sqlDatabases 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DocumentDB/databaseAccounts/sqlDatabases@2020-06-01-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 |
| 輸送量 |
每秒要求單位數。 例如,「輸送量」:10000。 |
整數 (int) |
ManagedServiceIdentity
| 名字 |
描述 |
價值 |
| 型別 |
用於資源的身分識別類型。 類型 'SystemAssigned,UserAssigned' 包含隱含建立的身分識別和一組使用者指派的身分識別。 類型 『None』 會從服務中移除任何身分識別。 |
“無” “系統分配” 'SystemAssigned,UserAssigned' 'UserAssigned' |
| 使用者指派的身份 |
與資源相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 |
ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
SqlDatabaseCreateUpdatePropertiesOrSqlDatabaseGetProperties
SqlDatabaseResourceOrSqlDatabaseGetPropertiesResource
| 名字 |
描述 |
價值 |
| 識別碼 |
Cosmos DB SQL 資料庫的名稱 |
字串 (必要) |
使用範例
在 Cosmos DB 帳戶內部署 SQL Database 的基本範例。
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 = ["*"]
}