- Latest
- 2025-11-01-プレビュー
- 2025-10-15
- 2025-05-01-preview
- 2025-04-15
- 2024-12-01-preview
- 2024-11-15
- 2024-09-01-preview
- 2024-08-15
- 2024-05-15
- 2024-05-15-preview
- 2024-02-15-preview
- 2023-11-15
- 2023-11-15-preview
- 2023-09-15
- 2023-09-15-preview
- 2023-04-15
- 2023-03-15
- 2023-03-15-preview
- 2023-03-01-preview
- 2022-11-15
- 2022-11-15-preview
- 2022-08-15
- 2022-08-15-preview
- 2022-05-15
- 2022-05-15-preview
- 2022-02-15-preview
- 2021-11-15-preview
- 2021-10-15
- 2021-10-15-preview
- 2021-07-01-preview
- 2021-06-15
- 2021-05-15
- 2021-04-15
- 2021-04-01-preview
- 2021-03-15
- 2021-03-01-preview
- 2021-01-15
- 2020-09-01
- 2020-06-01-preview
- 2020-04-01
- 2020-03-01
- 2019-12-12
- 2019-08-01
- 2016-03-31
- 2016-03-19
- 2015-11-06
- 2015-04-08
- 2015-04-01
Bicepリソースの定義
databaseAccounts リソースの種類は、次をターゲットとする操作と共にデプロイできます。
- リソース グループの - リソース グループのデプロイ コマンド 参照
各 API バージョンで変更されたプロパティの一覧については、変更ログの
リソース形式
Microsoftを作るために。DocumentDB/databaseAccounts リソースで、テンプレートに以下のBicepを追加してください。
resource symbolicname 'Microsoft.DocumentDB/databaseAccounts@2020-06-01-preview' = {
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {}
}
}
kind: 'string'
location: 'string'
name: 'string'
properties: {
apiProperties: {
serverVersion: 'string'
}
backupPolicy: {
type: 'string'
// For remaining properties, see BackupPolicy objects
}
capabilities: [
{
name: 'string'
}
]
connectorOffer: 'string'
consistencyPolicy: {
defaultConsistencyLevel: 'string'
maxIntervalInSeconds: int
maxStalenessPrefix: int
}
cors: [
{
allowedHeaders: 'string'
allowedMethods: 'string'
allowedOrigins: 'string'
exposedHeaders: 'string'
maxAgeInSeconds: int
}
]
databaseAccountOfferType: 'Standard'
disableKeyBasedMetadataWriteAccess: bool
enableAnalyticalStorage: bool
enableAutomaticFailover: bool
enableCassandraConnector: bool
enableFreeTier: bool
enableMultipleWriteLocations: bool
ipRules: [
{
ipAddressOrRange: 'string'
}
]
isVirtualNetworkFilterEnabled: bool
keyVaultKeyUri: 'string'
locations: [
{
failoverPriority: int
isZoneRedundant: bool
locationName: 'string'
}
]
virtualNetworkRules: [
{
id: 'string'
ignoreMissingVNetServiceEndpoint: bool
}
]
createMode: 'string'
// For remaining properties, see DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties objects
}
tags: {
{customized property}: 'string'
}
}
DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties オブジェクト
createMode プロパティを設定して、オブジェクトの種類を指定します。
既定 の場合は、次の値を使用します。
{
createMode: 'Default'
}
復元の場合は、次を使用します。
{
createMode: 'Restore'
restoreParameters: {
databasesToRestore: [
{
collectionNames: [
'string'
]
databaseName: 'string'
}
]
restoreMode: 'string'
restoreSource: 'string'
restoreTimestampInUtc: 'string'
}
}
BackupPolicy オブジェクト
型 プロパティを設定して、オブジェクトの型を指定します。
連続 の場合は、次の値を使用します。
{
type: 'Continuous'
}
定期的な
{
periodicModeProperties: {
backupIntervalInMinutes: int
backupRetentionIntervalInHours: int
backupStorageRedundancy: 'string'
}
type: 'Periodic'
}
プロパティ値
Microsoft。DocumentDB/databaseAccounts
| Name | Description | Value |
|---|---|---|
| ID | リソースの ID。 | ManagedServiceIdentity |
| kind | データベース アカウントの種類を示します。 これは、データベース アカウントの作成時にのみ設定できます。 | 'GlobalDocumentDB' 'MongoDB' 'Parse' |
| 位置 | リソースが属するリソース グループの場所。 | 文字列 |
| name | リソース名 | string Constraints: 最小長 = 3 最大長 = 50 パターン = ^[a-z0-9]+(-[a-z0-9]+)* (必須) |
| properties | Azure Cosmos DBデータベースアカウントの作成および更新のためのプロパティ。 | DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties (必須) |
| tags | リソース タグ | タグ名と値のディクショナリ。 テンプレート の |
ApiProperties
| Name | Description | Value |
|---|---|---|
| serverVersion | MongoDB アカウントの ServerVersion について説明します。 | '3.2' '3.6' |
BackupPolicy
| Name | Description | Value |
|---|---|---|
| 型 | ContinuousModeBackupPolicy型 |
'Continuous' 'periodic' (必須) |
Capability
| Name | Description | Value |
|---|---|---|
| name | Cosmos DB 機能の名前。 たとえば、"name": "EnableCassandra" です。 現在の値には、"EnableTable" と "EnableGremlin" も含まれます。 | 文字列 |
Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
| Name | Description | Value |
|---|
ConsistencyPolicy
| Name | Description | Value |
|---|---|---|
| defaultConsistencyLevel | Cosmos DB アカウントの既定の整合性レベルと構成設定。 | 'BoundedStaleness' 'ConsistentPrefix' 'Eventual' 'Session' 'Strong' (必須) |
| maxIntervalInSeconds | 有界整合性制約の整合性レベルで使用する場合、この値は許容される制約の時間量 (秒単位) を表します。 この値に使用できる範囲は 5 ~ 86400 です。 defaultConsistencyPolicy が 'BoundedStaleness' に設定されている場合に必要です。 | int Constraints: 最小値 = 5 最大値 = 86400 |
| maxStalenessPrefix | 有界整合性制約の整合性レベルで使用する場合、この値は許容される古い要求の数を表します。 この値に使用できる範囲は 1 ~ 2,147,483,647 です。 defaultConsistencyPolicy が 'BoundedStaleness' に設定されている場合に必要です。 | int Constraints: 最小値 = 1 最大値 = 2147483647 |
ContinuousModeBackupPolicy
| Name | Description | Value |
|---|---|---|
| 型 | バックアップのモードについて説明します。 | 'Continuous' (必須) |
CorsPolicy
| Name | Description | Value |
|---|---|---|
| allowedHeaders | 配信元ドメインが CORS 要求で指定できる要求ヘッダー。 | 文字列 |
| allowedMethods | 配信元ドメインが CORS 要求に使用できるメソッド (HTTP 要求動詞)。 | 文字列 |
| allowedOrigins | CORS 経由でサービスに対して要求を行うことができます。 | 文字列 (必須) |
| exposedHeaders | CORS 要求への応答で送信され、ブラウザーによって要求発行者に公開される可能性がある応答ヘッダー。 | 文字列 |
| maxAgeInSeconds | ブラウザーがプレフライト OPTIONS 要求をキャッシュする最大時間。 | int Constraints: 最小値 = 1 最大値 = 2147483647 |
DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties
| Name | Description | Value |
|---|---|---|
| apiProperties | API 固有のプロパティ。 現在、MongoDB API でのみサポートされています。 | ApiProperties |
| backupPolicy | アカウントでバックアップを作成するためのポリシーを表すオブジェクト。 | BackupPolicy |
| capabilities | アカウントの Cosmos DB 機能の一覧 | Capability[] |
| connectorOffer | Cosmos DB データベース C* アカウントの cassandra コネクタ オファーの種類。 | 'Small' |
| consistencyPolicy | Cosmos DB アカウントの整合性ポリシー。 | ConsistencyPolicy |
| cors | Cosmos DB データベース アカウントの CORS ポリシー。 | CorsPolicy[] |
| createMode | DefaultRequestDatabaseAccountCreateUpdateProperties 型の場合、'Default' に設定します。 RestoreReqeustDatabaseAccountCreateUpdateProperties 型の場合、'Restore' に設定します。 | 'Default' 「復元」(必須) |
| databaseAccountOfferType | データベースのオファーの種類 | 'Standard' (必須) |
| disableKeyBasedMetadataWriteAccess | アカウント キーを使用してメタデータ リソース (データベース、コンテナー、スループット) に対する書き込み操作を無効にする | bool |
| enableAnalyticalStorage | ストレージ分析を有効にするかどうかを示すフラグ。 | bool |
| enableAutomaticFailover | 障害が原因でリージョンが使用できないまれな場合に、書き込みリージョンの自動フェールオーバーを有効にします。 自動フェールオーバーでは、アカウントの新しい書き込みリージョンが作成され、アカウント用に構成されたフェールオーバーの優先順位に基づいて選択されます。 | bool |
| enableCassandraConnector | Cosmos DB C* アカウントで cassandra コネクタを有効にします | bool |
| enableFreeTier | Free レベルが有効かどうかを示すフラグ。 | bool |
| enableMultipleWriteLocations | アカウントを複数の場所に書き込める | bool |
| ipRules | IpRules の一覧。 | IpAddressOrRange[] |
| isVirtualNetworkFilterEnabled | Virtual Network ACLルールの有効化/無効化を示すフラグ。 | bool |
| keyVaultKeyUri | キー コンテナーの URI | 文字列 |
| locations | Cosmos DB アカウントで有効になっている georeplication の場所を含む配列。 | Location[] (必須) |
| virtualNetworkRules | Cosmos DBアカウント向けに設定されているVirtual Network ACLルールの一覧。 | VirtualNetworkRule[] |
DatabaseRestoreResource
| Name | Description | Value |
|---|---|---|
| collectionNames | 復元に使用できるコレクションの名前。 | string[] |
| databaseName | 復元に使用できるデータベースの名前。 | 文字列 |
DefaultRequestDatabaseAccountCreateUpdateProperties
| Name | Description | Value |
|---|---|---|
| createMode | アカウント作成モードを示す列挙型。 | 'デフォルト' (必須) |
IpAddressOrRange
| Name | Description | Value |
|---|---|---|
| ipAddressOrRange | 1 つの IPv4 アドレスまたは CIDR 形式の単一の IPv4 アドレス範囲。 IP アドレスは適切な形式である必要があり、10.0.0.0/8、100.64.0.0/10、172.16.0.0/12、192.168.0.0/16 のいずれかの範囲に含めることはできません。IP アドレス フィルターでは適用できないためです。 有効な入力の例: "23.40.210.245" または "23.40.210.0/8"。 | 文字列 |
Location
| Name | Description | Value |
|---|---|---|
| failoverPriority | リージョンのフェールオーバーの優先順位。 フェールオーバーの優先度が 0 の場合は、書き込みリージョンを示します。 フェールオーバー優先度の最大値 = (リージョンの合計数 - 1)。 フェールオーバー優先度の値は、データベース アカウントが存在するリージョンごとに一意である必要があります。 | int Constraints: 最小値 = 0 |
| isZoneRedundant | このリージョンが AvailabilityZone リージョンかどうかを示すフラグ | bool |
| locationName | リージョンの名前。 | 文字列 |
ManagedServiceIdentity
| Name | Description | Value |
|---|---|---|
| 型 | リソースに使用される ID の種類。 型 'SystemAssigned,UserAssigned' には、暗黙的に作成された ID とユーザー割り当て ID のセットの両方が含まれます。 型 'None' は、サービスからすべての ID を削除します。 | 'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities | リソースに関連付けられているユーザー ID の一覧。 ユーザー識別辞書のキー参照は、次の形式のARMリソースIDとなります:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft。ManagedIdentity/userAssignedIdentities/{identityName}'. | ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
| Name | Description | Value |
|---|
PeriodicModeBackupPolicy
| Name | Description | Value |
|---|---|---|
| periodicModeProperties | 定期モード バックアップの構成値 | PeriodicModeProperties |
| 型 | バックアップのモードについて説明します。 | 'periodic' (必須) |
PeriodicModeProperties
| Name | Description | Value |
|---|---|---|
| backupIntervalInMinutes | 2 つのバックアップ間の間隔を分単位で表す整数 | int Constraints: 最小値 = 0 |
| backupRetentionIntervalInHours | 各バックアップが保持される時間 (時間単位) を表す整数 | int Constraints: 最小値 = 0 |
| backupStorageRedundancy | バックアップの保存場所の種類を示す列挙型 | 'Geo' 'Local' 'Zone' |
RestoreParameters
| Name | Description | Value |
|---|---|---|
| databasesToRestore | 復元に使用できる特定のデータベースの一覧。 | DatabaseRestoreResource[] |
| restoreMode | 復元のモードについて説明します。 | 'PointInTime' |
| restoreSource | 復元を開始する必要がある復元可能なデータベース アカウントの ID。 例えば:/subscriptions/{subscriptionId}/providers/Microsoft。DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} | 文字列 |
| restoreTimestampInUtc | アカウントを復元する必要がある時間 (ISO-8601 形式)。 | 文字列 |
RestoreReqeustDatabaseAccountCreateUpdateProperties
| Name | Description | Value |
|---|---|---|
| createMode | アカウント作成モードを示す列挙型。 | 「復元」(必須) |
| restoreParameters | 復元に関する情報を示すパラメーター。 | RestoreParameters |
Tags
| Name | Description | Value |
|---|
VirtualNetworkRule
| Name | Description | Value |
|---|---|---|
| id | サブネットのリソースID、例えば /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft。Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. | 文字列 |
| ignoreMissingVNetServiceEndpoint | 仮想ネットワークで vnet サービス エンドポイントが有効になる前に、ファイアウォール規則を作成します。 | bool |
使用例
Bicep サンプル
CosmosDB (正式名称: DocumentDB) アカウントをデプロイする基本的な例です。
param resourceName string = 'acctest0001'
param location string = 'westeurope'
resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2021-10-15' = {
name: resourceName
location: location
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: []
}
}
Azure Verified Modules
以下のAzure検証済みモジュールはこのリソースタイプの展開に使用できます。
| Module | Description |
|---|---|
| Cosmos DBデータベースアカウント | Cosmos DB データベース アカウント用の AVM リソース モジュール |
Azure Quickstart Samples
以下の Azure クイックスタートテンプレートには、このリソースタイプのデプロイのためのBicepサンプルが含まれています。
| Bicepファイル | Description |
|---|---|
| Azure Cosmos DB account SQL API with analytical store | このテンプレートは、分析ストアで設定されたデータベースとコンテナを備えたCore(SQL)API用のAzure Cosmosアカウントを作成します。 |
| Azure Cosmos DB アカウントとウェブアプリ | このテンプレートはAzure Cosmos DBアカウント、App Service Planを展開し、App Service Plan内でWebアプリを作成します。 また、Azure Cosmos DBアカウントエンドポイントを参照する2つのアプリケーション設定もWebアプリに追加されます。 こうすることで、Webアプリにデプロイされたソリューションは、これらの設定を使ってAzure Cosmos DBアカウントのエンドポイントに接続できます。 |
| Microsoft Defender/c0を有効にしたCosmos DBアカウントを作成 | このARMテンプレートを使えば、Microsoft Defender for Azure Cosmos DBを有効にしたAzure Cosmos DBアカウントを展開できます。 Microsoft Defender for Azure Cosmos DBは、Azure Cosmos DBアカウント内のデータベースを悪用しようとする試みを検出する、Azureネイティブのセキュリティ層です。 Microsoft Defender for Azure Cosmos DBは、潜在的なSQLインジェクション、Microsoft脅威インテリジェンスに基づく既知の悪意ある攻撃者、疑わしいアクセスパターン、そして個人情報の侵害や悪意ある内部者によるデータベースの悪用の可能性を検出します。 |
| 無料版のAzure Cosmos DBアカウントを作成 | このテンプレートは、SQL API用の無料版Azure Cosmos DBアカウントを作成し、スループットとコンテナを共有するデータベースを提供します。 |
| このテンプレートは、Core(SQL)API用のAzure Cosmos DBアカウントを作成し、必要なリソースプロパティは最小限に指定します。 | |
| Create a Serverless Azure Cosmos DB account for SQL API | このテンプレートは、Core(SQL)API用のサーバーレスAzure Cosmos DBアカウントを作成します。 |
| このテンプレートはAzure Cosmosアカウントを作成し、Cosmos DBエンドポイントとキーをAzure Web App設定に注入し、GitHubからASP MVCウェブアプリを展開します。 | |
| このテンプレートは、共有スループットと専用スループット、2つのコレクションでMongoDB API 4.2用のAzure Cosmos DBアカウントを作成します。 | |
| このテンプレートは、共有および専用の自動スループットの両方を用いて、2つの地域でMongoDB API 4.2用のAzure Cosmos DBアカウントを作成します。 | |
| このテンプレートは、2つのリージョンでTable API用のAzure Cosmos DBアカウントを作成し、1つのテーブルでプロビジョニング済みスループットを利用できます。 | |
| このテンプレートは、2つのリージョンでTable API用のAzure Cosmos DBアカウントを作成し、オートスループットが自動スケールできる単一のテーブルを管理します。 | |
| このテンプレートは、Cassandra API用のAzure Cosmos DBアカウントを作成し、キースペースと専用スループットのテーブルを2つのリージョンで作成します。 | |
| このテンプレートは、Core(SQL)API用のAzure Cosmosアカウントを作成し、スループットと複数のオプションを持つコンテナを備えます。 | |
| このテンプレートは、専用スループットを用いて1つのデータベースと1つのグラフを持つ2つの地域でGremlin API用のAzure Cosmos DBアカウントを作成します。 | |
| このテンプレートは、Autoscale throughputを用いて1つのデータベースと1つのグラフで、2つの地域でGremlin API用のAzure Cosmos DBアカウントを作成します。 | |
| 複数の地域でAzure Cosmos DBアカウントを作成する | このテンプレートは、任意のデータベースAPIタイプに対して、プライマリとセカンダリーリージョンを持ち、整合性レベルとフェイルオーバータイプを選択できるAzure Cosmos DBアカウントを作成します。 |
| このテンプレートは、Core(SQL)API用のAzure Cosmosアカウントを作成し、データベースとコンテナ、自動スループット、その他複数のオプションを備えています。 | |
| このテンプレートでは、Cosmos アカウント、仮想ネットワーク、および仮想ネットワークに Cosmos アカウントを公開するプライベート エンドポイントが作成されます。 | |
| このテンプレートでは、SQL Cosmos アカウント、ネイティブに管理されるロール定義、および AAD ID のネイティブに管理されるロールの割り当てが作成されます。 | |
| Azure CosmosDBアカウントを作成 | この ARM テンプレートは、最小限の必須値で CosmosDB アカウントをすばやく作成することを目的としています |
| Create autoscale Azure Cosmos DB account for Cassandra API | このテンプレートは、Cassandra API用のAzure Cosmos DBアカウントを2つのリージョンで作成し、キースペースと自動スループットを持つテーブルを備えます。 |
| Create Azure Cosmos DB Core (SQL) API ストアドプロシージャ | このテンプレートは、Core(SQL)API用のAzure Cosmos DBアカウントと、ストアドプロシージャ、トリガー、ユーザー定義関数を備えたコンテナを作成します。 |
| Container Apps を使用して Dapr マイクロサービス アプリを作成します。 | |
| Container Apps を使用して Dapr pub-sub servicebus アプリを作成します。 | |
| Deploy Azure Data Explorer DB with Cosmos DB connection. |
ARM テンプレート リソース定義
databaseAccounts リソースの種類は、次をターゲットとする操作と共にデプロイできます。
- リソース グループの - リソース グループのデプロイ コマンド 参照
各 API バージョンで変更されたプロパティの一覧については、変更ログの
リソース形式
Microsoftを作るために。DocumentDB/databaseAccounts リソースで、テンプレートに以下のJSONを追加してください。
{
"type": "Microsoft.DocumentDB/databaseAccounts",
"apiVersion": "2020-06-01-preview",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
}
}
},
"kind": "string",
"location": "string",
"properties": {
"apiProperties": {
"serverVersion": "string"
},
"backupPolicy": {
"type": "string"
// For remaining properties, see BackupPolicy objects
},
"capabilities": [
{
"name": "string"
}
],
"connectorOffer": "string",
"consistencyPolicy": {
"defaultConsistencyLevel": "string",
"maxIntervalInSeconds": "int",
"maxStalenessPrefix": "int"
},
"cors": [
{
"allowedHeaders": "string",
"allowedMethods": "string",
"allowedOrigins": "string",
"exposedHeaders": "string",
"maxAgeInSeconds": "int"
}
],
"databaseAccountOfferType": "Standard",
"disableKeyBasedMetadataWriteAccess": "bool",
"enableAnalyticalStorage": "bool",
"enableAutomaticFailover": "bool",
"enableCassandraConnector": "bool",
"enableFreeTier": "bool",
"enableMultipleWriteLocations": "bool",
"ipRules": [
{
"ipAddressOrRange": "string"
}
],
"isVirtualNetworkFilterEnabled": "bool",
"keyVaultKeyUri": "string",
"locations": [
{
"failoverPriority": "int",
"isZoneRedundant": "bool",
"locationName": "string"
}
],
"virtualNetworkRules": [
{
"id": "string",
"ignoreMissingVNetServiceEndpoint": "bool"
}
],
"createMode": "string"
// For remaining properties, see DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties objects
},
"tags": {
"{customized property}": "string"
}
}
DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties オブジェクト
createMode プロパティを設定して、オブジェクトの種類を指定します。
既定 の場合は、次の値を使用します。
{
"createMode": "Default"
}
復元の場合は、次を使用します。
{
"createMode": "Restore",
"restoreParameters": {
"databasesToRestore": [
{
"collectionNames": [ "string" ],
"databaseName": "string"
}
],
"restoreMode": "string",
"restoreSource": "string",
"restoreTimestampInUtc": "string"
}
}
BackupPolicy オブジェクト
型 プロパティを設定して、オブジェクトの型を指定します。
連続 の場合は、次の値を使用します。
{
"type": "Continuous"
}
定期的な
{
"periodicModeProperties": {
"backupIntervalInMinutes": "int",
"backupRetentionIntervalInHours": "int",
"backupStorageRedundancy": "string"
},
"type": "Periodic"
}
プロパティ値
Microsoft。DocumentDB/databaseAccounts
| Name | Description | Value |
|---|---|---|
| apiVersion | API のバージョン | '2020-06-01-preview' |
| ID | リソースの ID。 | ManagedServiceIdentity |
| kind | データベース アカウントの種類を示します。 これは、データベース アカウントの作成時にのみ設定できます。 | 'GlobalDocumentDB' 'MongoDB' 'Parse' |
| 位置 | リソースが属するリソース グループの場所。 | 文字列 |
| name | リソース名 | string Constraints: 最小長 = 3 最大長 = 50 パターン = ^[a-z0-9]+(-[a-z0-9]+)* (必須) |
| properties | Azure Cosmos DBデータベースアカウントの作成および更新のためのプロパティ。 | DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties (必須) |
| tags | リソース タグ | タグ名と値のディクショナリ。 テンプレート の |
| 型 | リソースの種類 | 「Microsoft。DocumentDB/databaseAccounts' |
ApiProperties
| Name | Description | Value |
|---|---|---|
| serverVersion | MongoDB アカウントの ServerVersion について説明します。 | '3.2' '3.6' |
BackupPolicy
| Name | Description | Value |
|---|---|---|
| 型 | ContinuousModeBackupPolicy型 |
'Continuous' 'periodic' (必須) |
Capability
| Name | Description | Value |
|---|---|---|
| name | Cosmos DB 機能の名前。 たとえば、"name": "EnableCassandra" です。 現在の値には、"EnableTable" と "EnableGremlin" も含まれます。 | 文字列 |
Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
| Name | Description | Value |
|---|
ConsistencyPolicy
| Name | Description | Value |
|---|---|---|
| defaultConsistencyLevel | Cosmos DB アカウントの既定の整合性レベルと構成設定。 | 'BoundedStaleness' 'ConsistentPrefix' 'Eventual' 'Session' 'Strong' (必須) |
| maxIntervalInSeconds | 有界整合性制約の整合性レベルで使用する場合、この値は許容される制約の時間量 (秒単位) を表します。 この値に使用できる範囲は 5 ~ 86400 です。 defaultConsistencyPolicy が 'BoundedStaleness' に設定されている場合に必要です。 | int Constraints: 最小値 = 5 最大値 = 86400 |
| maxStalenessPrefix | 有界整合性制約の整合性レベルで使用する場合、この値は許容される古い要求の数を表します。 この値に使用できる範囲は 1 ~ 2,147,483,647 です。 defaultConsistencyPolicy が 'BoundedStaleness' に設定されている場合に必要です。 | int Constraints: 最小値 = 1 最大値 = 2147483647 |
ContinuousModeBackupPolicy
| Name | Description | Value |
|---|---|---|
| 型 | バックアップのモードについて説明します。 | 'Continuous' (必須) |
CorsPolicy
| Name | Description | Value |
|---|---|---|
| allowedHeaders | 配信元ドメインが CORS 要求で指定できる要求ヘッダー。 | 文字列 |
| allowedMethods | 配信元ドメインが CORS 要求に使用できるメソッド (HTTP 要求動詞)。 | 文字列 |
| allowedOrigins | CORS 経由でサービスに対して要求を行うことができます。 | 文字列 (必須) |
| exposedHeaders | CORS 要求への応答で送信され、ブラウザーによって要求発行者に公開される可能性がある応答ヘッダー。 | 文字列 |
| maxAgeInSeconds | ブラウザーがプレフライト OPTIONS 要求をキャッシュする最大時間。 | int Constraints: 最小値 = 1 最大値 = 2147483647 |
DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties
| Name | Description | Value |
|---|---|---|
| apiProperties | API 固有のプロパティ。 現在、MongoDB API でのみサポートされています。 | ApiProperties |
| backupPolicy | アカウントでバックアップを作成するためのポリシーを表すオブジェクト。 | BackupPolicy |
| capabilities | アカウントの Cosmos DB 機能の一覧 | Capability[] |
| connectorOffer | Cosmos DB データベース C* アカウントの cassandra コネクタ オファーの種類。 | 'Small' |
| consistencyPolicy | Cosmos DB アカウントの整合性ポリシー。 | ConsistencyPolicy |
| cors | Cosmos DB データベース アカウントの CORS ポリシー。 | CorsPolicy[] |
| createMode | DefaultRequestDatabaseAccountCreateUpdateProperties 型の場合、'Default' に設定します。 RestoreReqeustDatabaseAccountCreateUpdateProperties 型の場合、'Restore' に設定します。 | 'Default' 「復元」(必須) |
| databaseAccountOfferType | データベースのオファーの種類 | 'Standard' (必須) |
| disableKeyBasedMetadataWriteAccess | アカウント キーを使用してメタデータ リソース (データベース、コンテナー、スループット) に対する書き込み操作を無効にする | bool |
| enableAnalyticalStorage | ストレージ分析を有効にするかどうかを示すフラグ。 | bool |
| enableAutomaticFailover | 障害が原因でリージョンが使用できないまれな場合に、書き込みリージョンの自動フェールオーバーを有効にします。 自動フェールオーバーでは、アカウントの新しい書き込みリージョンが作成され、アカウント用に構成されたフェールオーバーの優先順位に基づいて選択されます。 | bool |
| enableCassandraConnector | Cosmos DB C* アカウントで cassandra コネクタを有効にします | bool |
| enableFreeTier | Free レベルが有効かどうかを示すフラグ。 | bool |
| enableMultipleWriteLocations | アカウントを複数の場所に書き込める | bool |
| ipRules | IpRules の一覧。 | IpAddressOrRange[] |
| isVirtualNetworkFilterEnabled | Virtual Network ACLルールの有効化/無効化を示すフラグ。 | bool |
| keyVaultKeyUri | キー コンテナーの URI | 文字列 |
| locations | Cosmos DB アカウントで有効になっている georeplication の場所を含む配列。 | Location[] (必須) |
| virtualNetworkRules | Cosmos DBアカウント向けに設定されているVirtual Network ACLルールの一覧。 | VirtualNetworkRule[] |
DatabaseRestoreResource
| Name | Description | Value |
|---|---|---|
| collectionNames | 復元に使用できるコレクションの名前。 | string[] |
| databaseName | 復元に使用できるデータベースの名前。 | 文字列 |
DefaultRequestDatabaseAccountCreateUpdateProperties
| Name | Description | Value |
|---|---|---|
| createMode | アカウント作成モードを示す列挙型。 | 'デフォルト' (必須) |
IpAddressOrRange
| Name | Description | Value |
|---|---|---|
| ipAddressOrRange | 1 つの IPv4 アドレスまたは CIDR 形式の単一の IPv4 アドレス範囲。 IP アドレスは適切な形式である必要があり、10.0.0.0/8、100.64.0.0/10、172.16.0.0/12、192.168.0.0/16 のいずれかの範囲に含めることはできません。IP アドレス フィルターでは適用できないためです。 有効な入力の例: "23.40.210.245" または "23.40.210.0/8"。 | 文字列 |
Location
| Name | Description | Value |
|---|---|---|
| failoverPriority | リージョンのフェールオーバーの優先順位。 フェールオーバーの優先度が 0 の場合は、書き込みリージョンを示します。 フェールオーバー優先度の最大値 = (リージョンの合計数 - 1)。 フェールオーバー優先度の値は、データベース アカウントが存在するリージョンごとに一意である必要があります。 | int Constraints: 最小値 = 0 |
| isZoneRedundant | このリージョンが AvailabilityZone リージョンかどうかを示すフラグ | bool |
| locationName | リージョンの名前。 | 文字列 |
ManagedServiceIdentity
| Name | Description | Value |
|---|---|---|
| 型 | リソースに使用される ID の種類。 型 'SystemAssigned,UserAssigned' には、暗黙的に作成された ID とユーザー割り当て ID のセットの両方が含まれます。 型 'None' は、サービスからすべての ID を削除します。 | 'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities | リソースに関連付けられているユーザー ID の一覧。 ユーザー識別辞書のキー参照は、次の形式のARMリソースIDとなります:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft。ManagedIdentity/userAssignedIdentities/{identityName}'. | ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
| Name | Description | Value |
|---|
PeriodicModeBackupPolicy
| Name | Description | Value |
|---|---|---|
| periodicModeProperties | 定期モード バックアップの構成値 | PeriodicModeProperties |
| 型 | バックアップのモードについて説明します。 | 'periodic' (必須) |
PeriodicModeProperties
| Name | Description | Value |
|---|---|---|
| backupIntervalInMinutes | 2 つのバックアップ間の間隔を分単位で表す整数 | int Constraints: 最小値 = 0 |
| backupRetentionIntervalInHours | 各バックアップが保持される時間 (時間単位) を表す整数 | int Constraints: 最小値 = 0 |
| backupStorageRedundancy | バックアップの保存場所の種類を示す列挙型 | 'Geo' 'Local' 'Zone' |
RestoreParameters
| Name | Description | Value |
|---|---|---|
| databasesToRestore | 復元に使用できる特定のデータベースの一覧。 | DatabaseRestoreResource[] |
| restoreMode | 復元のモードについて説明します。 | 'PointInTime' |
| restoreSource | 復元を開始する必要がある復元可能なデータベース アカウントの ID。 例えば:/subscriptions/{subscriptionId}/providers/Microsoft。DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} | 文字列 |
| restoreTimestampInUtc | アカウントを復元する必要がある時間 (ISO-8601 形式)。 | 文字列 |
RestoreReqeustDatabaseAccountCreateUpdateProperties
| Name | Description | Value |
|---|---|---|
| createMode | アカウント作成モードを示す列挙型。 | 「復元」(必須) |
| restoreParameters | 復元に関する情報を示すパラメーター。 | RestoreParameters |
Tags
| Name | Description | Value |
|---|
VirtualNetworkRule
| Name | Description | Value |
|---|---|---|
| id | サブネットのリソースID、例えば /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft。Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. | 文字列 |
| ignoreMissingVNetServiceEndpoint | 仮想ネットワークで vnet サービス エンドポイントが有効になる前に、ファイアウォール規則を作成します。 | bool |
使用例
Azure Quickstart Templates
以下のAzureクイックスタートテンプレートはこのリソースタイプを展開します。
| Template | Description |
|---|---|
|
Azure Cosmos DB account SQL API with analytical store |
このテンプレートは、分析ストアで設定されたデータベースとコンテナを備えたCore(SQL)API用のAzure Cosmosアカウントを作成します。 |
|
Azure Cosmos DB アカウントとウェブアプリ |
このテンプレートはAzure Cosmos DBアカウント、App Service Planを展開し、App Service Plan内でWebアプリを作成します。 また、Azure Cosmos DBアカウントエンドポイントを参照する2つのアプリケーション設定もWebアプリに追加されます。 こうすることで、Webアプリにデプロイされたソリューションは、これらの設定を使ってAzure Cosmos DBアカウントのエンドポイントに接続できます。 |
|
CI/CDを用いてJenkinsをAzureコンテナサービス(AKS) |
コンテナーを使用すると、アプリケーションを継続的にビルドしてデプロイすることが非常に簡単になります。 Azure Container ServiceでKubernetesを使ってこれらのコンテナのデプロイをオーケストレーションすることで、複製可能で管理しやすいクラスターを実現できます。 コンテナー イメージとオーケストレーションを生成するように継続的ビルドを設定することで、デプロイの速度と信頼性を向上させることができます。 |
|
Microsoft Defender/c0を有効にしたCosmos DBアカウントを作成 |
このARMテンプレートを使えば、Microsoft Defender for Azure Cosmos DBを有効にしたAzure Cosmos DBアカウントを展開できます。 Microsoft Defender for Azure Cosmos DBは、Azure Cosmos DBアカウント内のデータベースを悪用しようとする試みを検出する、Azureネイティブのセキュリティ層です。 Microsoft Defender for Azure Cosmos DBは、潜在的なSQLインジェクション、Microsoft脅威インテリジェンスに基づく既知の悪意ある攻撃者、疑わしいアクセスパターン、そして個人情報の侵害や悪意ある内部者によるデータベースの悪用の可能性を検出します。 |
|
無料版のAzure Cosmos DBアカウントを作成 |
このテンプレートは、SQL API用の無料版Azure Cosmos DBアカウントを作成し、スループットとコンテナを共有するデータベースを提供します。 |
| このテンプレートは、Core(SQL)API用のAzure Cosmos DBアカウントを作成し、必要なリソースプロパティは最小限に指定します。 | |
|
Create a Serverless Azure Cosmos DB account for SQL API |
このテンプレートは、Core(SQL)API用のサーバーレスAzure Cosmos DBアカウントを作成します。 |
| このテンプレートはAzure Cosmosアカウントを作成し、Cosmos DBエンドポイントとキーをAzure Web App設定に注入し、GitHubからASP MVCウェブアプリを展開します。 | |
| このテンプレートは、共有スループットと専用スループット、2つのコレクションでMongoDB API 4.2用のAzure Cosmos DBアカウントを作成します。 | |
| このテンプレートは、共有および専用の自動スループットの両方を用いて、2つの地域でMongoDB API 4.2用のAzure Cosmos DBアカウントを作成します。 | |
| このテンプレートは、2つのリージョンでTable API用のAzure Cosmos DBアカウントを作成し、1つのテーブルでプロビジョニング済みスループットを利用できます。 | |
| このテンプレートは、2つのリージョンでTable API用のAzure Cosmos DBアカウントを作成し、オートスループットが自動スケールできる単一のテーブルを管理します。 | |
| このテンプレートは、Cassandra API用のAzure Cosmos DBアカウントを作成し、キースペースと専用スループットのテーブルを2つのリージョンで作成します。 | |
| このテンプレートは、Core(SQL)API用のAzure Cosmosアカウントを作成し、スループットと複数のオプションを持つコンテナを備えます。 | |
| このテンプレートは、専用スループットを用いて1つのデータベースと1つのグラフを持つ2つの地域でGremlin API用のAzure Cosmos DBアカウントを作成します。 | |
| このテンプレートは、Autoscale throughputを用いて1つのデータベースと1つのグラフで、2つの地域でGremlin API用のAzure Cosmos DBアカウントを作成します。 | |
|
複数の地域でAzure Cosmos DBアカウントを作成する |
このテンプレートは、任意のデータベースAPIタイプに対して、プライマリとセカンダリーリージョンを持ち、整合性レベルとフェイルオーバータイプを選択できるAzure Cosmos DBアカウントを作成します。 |
| このテンプレートは、Core(SQL)API用のAzure Cosmosアカウントを作成し、データベースとコンテナ、自動スループット、その他複数のオプションを備えています。 | |
| このテンプレートでは、Cosmos アカウント、仮想ネットワーク、および仮想ネットワークに Cosmos アカウントを公開するプライベート エンドポイントが作成されます。 | |
| このテンプレートでは、SQL Cosmos アカウント、ネイティブに管理されるロール定義、および AAD ID のネイティブに管理されるロールの割り当てが作成されます。 | |
|
Azure CosmosDBアカウントを作成 |
この ARM テンプレートは、最小限の必須値で CosmosDB アカウントをすばやく作成することを目的としています |
|
Create autoscale Azure Cosmos DB account for Cassandra API |
このテンプレートは、Cassandra API用のAzure Cosmos DBアカウントを2つのリージョンで作成し、キースペースと自動スループットを持つテーブルを備えます。 |
|
Create Azure Cosmos DB Core (SQL) API ストアドプロシージャ |
このテンプレートは、Core(SQL)API用のAzure Cosmos DBアカウントと、ストアドプロシージャ、トリガー、ユーザー定義関数を備えたコンテナを作成します。 |
| このテンプレートでは、SQL API を使用して Cosmos コンテナーを作成し、複数のコンテナーを追加できます。 | |
| Container Apps を使用して Dapr マイクロサービス アプリを作成します。 | |
| Container Apps を使用して Dapr pub-sub servicebus アプリを作成します。 | |
| Deploy Azure Data Explorer DB with Cosmos DB connection. | |
|
Webアプリ、SQLデータベース、Azure Cosmos DB、Azure Search |
このテンプレートは、Webアプリ、SQLデータベース、Azure Cosmos DB、Azure Search、Application Insightsをプロビジョニングします。 |
Terraform (AzAPI プロバイダー) リソース定義
databaseAccounts リソースの種類は、次をターゲットとする操作と共にデプロイできます。
- リソース グループ
各 API バージョンで変更されたプロパティの一覧については、変更ログの
リソース形式
Microsoftを作るために。DocumentDB/databaseAccounts リソースで、テンプレートに以下のTerraformを追加してください。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DocumentDB/databaseAccounts@2020-06-01-preview"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
kind = "string"
properties = {
apiProperties = {
serverVersion = "string"
}
backupPolicy = {
type = "string"
// For remaining properties, see BackupPolicy objects
}
capabilities = [
{
name = "string"
}
]
connectorOffer = "string"
consistencyPolicy = {
defaultConsistencyLevel = "string"
maxIntervalInSeconds = int
maxStalenessPrefix = int
}
cors = [
{
allowedHeaders = "string"
allowedMethods = "string"
allowedOrigins = "string"
exposedHeaders = "string"
maxAgeInSeconds = int
}
]
databaseAccountOfferType = "Standard"
disableKeyBasedMetadataWriteAccess = bool
enableAnalyticalStorage = bool
enableAutomaticFailover = bool
enableCassandraConnector = bool
enableFreeTier = bool
enableMultipleWriteLocations = bool
ipRules = [
{
ipAddressOrRange = "string"
}
]
isVirtualNetworkFilterEnabled = bool
keyVaultKeyUri = "string"
locations = [
{
failoverPriority = int
isZoneRedundant = bool
locationName = "string"
}
]
virtualNetworkRules = [
{
id = "string"
ignoreMissingVNetServiceEndpoint = bool
}
]
createMode = "string"
// For remaining properties, see DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties objects
}
}
}
DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties オブジェクト
createMode プロパティを設定して、オブジェクトの種類を指定します。
既定 の場合は、次の値を使用します。
{
createMode = "Default"
}
復元の場合は、次を使用します。
{
createMode = "Restore"
restoreParameters = {
databasesToRestore = [
{
collectionNames = [
"string"
]
databaseName = "string"
}
]
restoreMode = "string"
restoreSource = "string"
restoreTimestampInUtc = "string"
}
}
BackupPolicy オブジェクト
型 プロパティを設定して、オブジェクトの型を指定します。
連続 の場合は、次の値を使用します。
{
type = "Continuous"
}
定期的な
{
periodicModeProperties = {
backupIntervalInMinutes = int
backupRetentionIntervalInHours = int
backupStorageRedundancy = "string"
}
type = "Periodic"
}
プロパティ値
Microsoft。DocumentDB/databaseAccounts
| Name | Description | Value |
|---|---|---|
| ID | リソースの ID。 | ManagedServiceIdentity |
| kind | データベース アカウントの種類を示します。 これは、データベース アカウントの作成時にのみ設定できます。 | 'GlobalDocumentDB' 'MongoDB' 'Parse' |
| 位置 | リソースが属するリソース グループの場所。 | 文字列 |
| name | リソース名 | string Constraints: 最小長 = 3 最大長 = 50 パターン = ^[a-z0-9]+(-[a-z0-9]+)* (必須) |
| properties | Azure Cosmos DBデータベースアカウントの作成および更新のためのプロパティ。 | DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties (必須) |
| tags | リソース タグ | タグ名と値のディクショナリ。 |
| 型 | リソースの種類 | 「Microsoft。DocumentDB/databaseAccounts@2020-06-01-preview" |
ApiProperties
| Name | Description | Value |
|---|---|---|
| serverVersion | MongoDB アカウントの ServerVersion について説明します。 | '3.2' '3.6' |
BackupPolicy
| Name | Description | Value |
|---|---|---|
| 型 | ContinuousModeBackupPolicy型 |
'Continuous' 'periodic' (必須) |
Capability
| Name | Description | Value |
|---|---|---|
| name | Cosmos DB 機能の名前。 たとえば、"name": "EnableCassandra" です。 現在の値には、"EnableTable" と "EnableGremlin" も含まれます。 | 文字列 |
Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties
| Name | Description | Value |
|---|
ConsistencyPolicy
| Name | Description | Value |
|---|---|---|
| defaultConsistencyLevel | Cosmos DB アカウントの既定の整合性レベルと構成設定。 | 'BoundedStaleness' 'ConsistentPrefix' 'Eventual' 'Session' 'Strong' (必須) |
| maxIntervalInSeconds | 有界整合性制約の整合性レベルで使用する場合、この値は許容される制約の時間量 (秒単位) を表します。 この値に使用できる範囲は 5 ~ 86400 です。 defaultConsistencyPolicy が 'BoundedStaleness' に設定されている場合に必要です。 | int Constraints: 最小値 = 5 最大値 = 86400 |
| maxStalenessPrefix | 有界整合性制約の整合性レベルで使用する場合、この値は許容される古い要求の数を表します。 この値に使用できる範囲は 1 ~ 2,147,483,647 です。 defaultConsistencyPolicy が 'BoundedStaleness' に設定されている場合に必要です。 | int Constraints: 最小値 = 1 最大値 = 2147483647 |
ContinuousModeBackupPolicy
| Name | Description | Value |
|---|---|---|
| 型 | バックアップのモードについて説明します。 | 'Continuous' (必須) |
CorsPolicy
| Name | Description | Value |
|---|---|---|
| allowedHeaders | 配信元ドメインが CORS 要求で指定できる要求ヘッダー。 | 文字列 |
| allowedMethods | 配信元ドメインが CORS 要求に使用できるメソッド (HTTP 要求動詞)。 | 文字列 |
| allowedOrigins | CORS 経由でサービスに対して要求を行うことができます。 | 文字列 (必須) |
| exposedHeaders | CORS 要求への応答で送信され、ブラウザーによって要求発行者に公開される可能性がある応答ヘッダー。 | 文字列 |
| maxAgeInSeconds | ブラウザーがプレフライト OPTIONS 要求をキャッシュする最大時間。 | int Constraints: 最小値 = 1 最大値 = 2147483647 |
DatabaseAccountCreateUpdatePropertiesOrDatabaseAccountGetProperties
| Name | Description | Value |
|---|---|---|
| apiProperties | API 固有のプロパティ。 現在、MongoDB API でのみサポートされています。 | ApiProperties |
| backupPolicy | アカウントでバックアップを作成するためのポリシーを表すオブジェクト。 | BackupPolicy |
| capabilities | アカウントの Cosmos DB 機能の一覧 | Capability[] |
| connectorOffer | Cosmos DB データベース C* アカウントの cassandra コネクタ オファーの種類。 | 'Small' |
| consistencyPolicy | Cosmos DB アカウントの整合性ポリシー。 | ConsistencyPolicy |
| cors | Cosmos DB データベース アカウントの CORS ポリシー。 | CorsPolicy[] |
| createMode | DefaultRequestDatabaseAccountCreateUpdateProperties 型の場合、'Default' に設定します。 RestoreReqeustDatabaseAccountCreateUpdateProperties 型の場合、'Restore' に設定します。 | 'Default' 「復元」(必須) |
| databaseAccountOfferType | データベースのオファーの種類 | 'Standard' (必須) |
| disableKeyBasedMetadataWriteAccess | アカウント キーを使用してメタデータ リソース (データベース、コンテナー、スループット) に対する書き込み操作を無効にする | bool |
| enableAnalyticalStorage | ストレージ分析を有効にするかどうかを示すフラグ。 | bool |
| enableAutomaticFailover | 障害が原因でリージョンが使用できないまれな場合に、書き込みリージョンの自動フェールオーバーを有効にします。 自動フェールオーバーでは、アカウントの新しい書き込みリージョンが作成され、アカウント用に構成されたフェールオーバーの優先順位に基づいて選択されます。 | bool |
| enableCassandraConnector | Cosmos DB C* アカウントで cassandra コネクタを有効にします | bool |
| enableFreeTier | Free レベルが有効かどうかを示すフラグ。 | bool |
| enableMultipleWriteLocations | アカウントを複数の場所に書き込める | bool |
| ipRules | IpRules の一覧。 | IpAddressOrRange[] |
| isVirtualNetworkFilterEnabled | Virtual Network ACLルールの有効化/無効化を示すフラグ。 | bool |
| keyVaultKeyUri | キー コンテナーの URI | 文字列 |
| locations | Cosmos DB アカウントで有効になっている georeplication の場所を含む配列。 | Location[] (必須) |
| virtualNetworkRules | Cosmos DBアカウント向けに設定されているVirtual Network ACLルールの一覧。 | VirtualNetworkRule[] |
DatabaseRestoreResource
| Name | Description | Value |
|---|---|---|
| collectionNames | 復元に使用できるコレクションの名前。 | string[] |
| databaseName | 復元に使用できるデータベースの名前。 | 文字列 |
DefaultRequestDatabaseAccountCreateUpdateProperties
| Name | Description | Value |
|---|---|---|
| createMode | アカウント作成モードを示す列挙型。 | 'デフォルト' (必須) |
IpAddressOrRange
| Name | Description | Value |
|---|---|---|
| ipAddressOrRange | 1 つの IPv4 アドレスまたは CIDR 形式の単一の IPv4 アドレス範囲。 IP アドレスは適切な形式である必要があり、10.0.0.0/8、100.64.0.0/10、172.16.0.0/12、192.168.0.0/16 のいずれかの範囲に含めることはできません。IP アドレス フィルターでは適用できないためです。 有効な入力の例: "23.40.210.245" または "23.40.210.0/8"。 | 文字列 |
Location
| Name | Description | Value |
|---|---|---|
| failoverPriority | リージョンのフェールオーバーの優先順位。 フェールオーバーの優先度が 0 の場合は、書き込みリージョンを示します。 フェールオーバー優先度の最大値 = (リージョンの合計数 - 1)。 フェールオーバー優先度の値は、データベース アカウントが存在するリージョンごとに一意である必要があります。 | int Constraints: 最小値 = 0 |
| isZoneRedundant | このリージョンが AvailabilityZone リージョンかどうかを示すフラグ | bool |
| locationName | リージョンの名前。 | 文字列 |
ManagedServiceIdentity
| Name | Description | Value |
|---|---|---|
| 型 | リソースに使用される ID の種類。 型 'SystemAssigned,UserAssigned' には、暗黙的に作成された ID とユーザー割り当て ID のセットの両方が含まれます。 型 'None' は、サービスからすべての ID を削除します。 | 'None' 'SystemAssigned' 'SystemAssigned,UserAssigned' 'UserAssigned' |
| userAssignedIdentities | リソースに関連付けられているユーザー ID の一覧。 ユーザー識別辞書のキー参照は、次の形式のARMリソースIDとなります:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft。ManagedIdentity/userAssignedIdentities/{identityName}'. | ManagedServiceIdentityUserAssignedIdentities |
ManagedServiceIdentityUserAssignedIdentities
| Name | Description | Value |
|---|
PeriodicModeBackupPolicy
| Name | Description | Value |
|---|---|---|
| periodicModeProperties | 定期モード バックアップの構成値 | PeriodicModeProperties |
| 型 | バックアップのモードについて説明します。 | 'periodic' (必須) |
PeriodicModeProperties
| Name | Description | Value |
|---|---|---|
| backupIntervalInMinutes | 2 つのバックアップ間の間隔を分単位で表す整数 | int Constraints: 最小値 = 0 |
| backupRetentionIntervalInHours | 各バックアップが保持される時間 (時間単位) を表す整数 | int Constraints: 最小値 = 0 |
| backupStorageRedundancy | バックアップの保存場所の種類を示す列挙型 | 'Geo' 'Local' 'Zone' |
RestoreParameters
| Name | Description | Value |
|---|---|---|
| databasesToRestore | 復元に使用できる特定のデータベースの一覧。 | DatabaseRestoreResource[] |
| restoreMode | 復元のモードについて説明します。 | 'PointInTime' |
| restoreSource | 復元を開始する必要がある復元可能なデータベース アカウントの ID。 例えば:/subscriptions/{subscriptionId}/providers/Microsoft。DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} | 文字列 |
| restoreTimestampInUtc | アカウントを復元する必要がある時間 (ISO-8601 形式)。 | 文字列 |
RestoreReqeustDatabaseAccountCreateUpdateProperties
| Name | Description | Value |
|---|---|---|
| createMode | アカウント作成モードを示す列挙型。 | 「復元」(必須) |
| restoreParameters | 復元に関する情報を示すパラメーター。 | RestoreParameters |
Tags
| Name | Description | Value |
|---|
VirtualNetworkRule
| Name | Description | Value |
|---|---|---|
| id | サブネットのリソースID、例えば /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft。Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. | 文字列 |
| ignoreMissingVNetServiceEndpoint | 仮想ネットワークで vnet サービス エンドポイントが有効になる前に、ファイアウォール規則を作成します。 | bool |
使用例
Terraformサンプル
CosmosDB (正式名称: DocumentDB) アカウントをデプロイする基本的な例です。
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 = ["*"]
}