次の方法で共有


Microsoft.DocumentDB databaseAccounts/mongodbDatabases/collections

Bicep リソース定義

databaseAccounts/mongodbDatabases/collections リソースの種類は、次を対象とする操作でデプロイできます。

各 API バージョンの変更されたプロパティの一覧については、「 変更ログ」を参照してください。

リソース形式

Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections リソースを作成するには、次の Bicep をテンプレートに追加します。

resource symbolicname 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2024-05-15' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  parent: resourceSymbolicName
  properties: {
    options: {
      autoscaleSettings: {
        maxThroughput: int
      }
      throughput: int
    }
    resource: {
      analyticalStorageTtl: int
      createMode: 'string'
      id: 'string'
      indexes: [
        {
          key: {
            keys: [
              'string'
            ]
          }
          options: {
            expireAfterSeconds: int
            unique: bool
          }
        }
      ]
      restoreParameters: {
        restoreSource: 'string'
        restoreTimestampInUtc: 'string'
      }
      shardKey: {
        {customized property}: 'string'
      }
    }
  }
}

プロパティ値

databaseAccounts/mongodbDatabases/collections

名前 説明
name リソース名

Bicep で子リソースの名前と型を設定する方法を参照してください。
string (必須)
location リソースが属しているリソース グループの場所。 string
tags タグは、リソースを記述するキーと値のペアの一覧です。 これらのタグはリソース グループをまたがってこのリソースを表示およびグループ化する際に使用できます。 リソースには最大 15 個のタグを指定できます。 各タグには 128 文字以内のキーと、256 文字以内の値が必要です。 たとえば、テンプレートの種類の既定のエクスペリエンスは"defaultExperience": "Cassandra" に設定されます。 現在の "defaultExperience" 値には、"Table"、"Graph"、"DocumentDB"、"MongoDB" も含まれます。 タグ名と値のディクショナリ。 「テンプレートのタグ」を参照してください
parent Bicep では、子リソースの親リソースを指定できます。 このプロパティを追加する必要があるのは、子リソースが親リソースの外部で宣言されている場合のみです。

詳細については、「 親リソースの外部にある子リソース」を参照してください。
型のリソースのシンボル名: mongodbDatabases
properties Azure Cosmos DB MongoDB コレクションを作成および更新するためのプロパティ。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl... (必須)

MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl...

名前 説明
options 要求に適用するオプションのキーと値のペア。 これは、要求と共に送信されるヘッダーに対応します。 CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...
resource MongoDB コレクションの標準 JSON 形式 MongoDBCollectionResourceOrMongoDBCollectionGetPrope... (必須)

CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...

名前 説明
autoscaleSettings 自動スケーリングの設定を指定します。 注: スループットまたは自動scaleSettings は必須ですが、両方は必要ありません。 AutoscaleSettings
throughput 1 秒あたりの要求ユニット数。 たとえば、"throughput": 10000 です。 INT

AutoscaleSettings

名前 説明
maxThroughput リソースがスケールアップできる最大スループットを表します。 INT

MongoDBCollectionResourceOrMongoDBCollectionGetPrope...

名前 説明
analyticalStorageTtl 分析 TTL。 INT
createMode リソースの作成モードを示す列挙型。 'Default'
'Restore'
id Cosmos DB MongoDB コレクションの名前 string (必須)
インデックス インデックス キーの一覧 MongoIndex[]
restoreParameters 復元に関する情報を示すパラメーター ResourceRestoreParameters
shardKey 要求に適用されるシャード キーのキーと値のペア。 ShardKeys

MongoIndex

名前 説明
キー Cosmos DB MongoDB コレクションのインデックス キー MongoIndexKeys
options Cosmos DB MongoDB コレクションのインデックス キー オプション MongoIndexOptions

MongoIndexKeys

名前 説明
キー Azure Cosmos DB サービス内の各 MongoDB コレクションのキーの一覧 string[]

MongoIndexOptions

名前 説明
expireAfterSeconds 秒後に有効期限が切れる INT
unique 一意かどうか [bool]

ResourceRestoreParameters

名前 説明
restoreSource 復元を開始する必要がある復元可能なデータベース アカウントの ID。 例: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} string
restoreTimestampInUtc アカウントを復元する必要がある時間 (ISO-8601 形式)。 string

ShardKeys

名前 説明
{カスタマイズされたプロパティ} string

クイック スタート テンプレート

次のクイックスタート テンプレートでは、このリソースの種類をデプロイします。

Template 説明
MongoDB API 用の Azure Cosmos アカウントを作成する

Azure にデプロイする
このテンプレートでは、2 つのコレクションで共有スループットと専用スループットを使用して、MongoDB API 4.2 用の Azure Cosmos DB アカウントを 2 つのリージョンに作成します。
MongoDB API 自動スケーリング用の Azure Cosmos アカウントを作成する

Azure にデプロイする
このテンプレートでは、共有と専用の自動スケーリングの両方のスループットを使用して、MongoDB API 4.2 用の Azure Cosmos DB アカウントを 2 つのリージョンに作成します。

ARM テンプレート リソース定義

databaseAccounts/mongodbDatabases/collections リソースの種類は、次をターゲットとする操作と共にデプロイできます。

各 API バージョンの変更されたプロパティの一覧については、「 変更ログ」を参照してください。

リソース形式

Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections リソースを作成するには、テンプレートに次の JSON を追加します。

{
  "type": "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections",
  "apiVersion": "2024-05-15",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "options": {
      "autoscaleSettings": {
        "maxThroughput": "int"
      },
      "throughput": "int"
    },
    "resource": {
      "analyticalStorageTtl": "int",
      "createMode": "string",
      "id": "string",
      "indexes": [
        {
          "key": {
            "keys": [ "string" ]
          },
          "options": {
            "expireAfterSeconds": "int",
            "unique": "bool"
          }
        }
      ],
      "restoreParameters": {
        "restoreSource": "string",
        "restoreTimestampInUtc": "string"
      },
      "shardKey": {
        "{customized property}": "string"
      }
    }
  }
}

プロパティ値

databaseAccounts/mongodbDatabases/collections

名前 説明
type リソースの種類 'Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections'
apiVersion リソース API のバージョン '2024-05-15'
name リソース名

JSON ARM テンプレートで子リソースの名前と型を設定する方法を参照してください。
string (必須)
location リソースが属しているリソース グループの場所。 string
tags タグは、リソースを記述するキーと値のペアの一覧です。 これらのタグはリソース グループをまたがってこのリソースを表示およびグループ化する際に使用できます。 リソースには最大 15 個のタグを指定できます。 各タグには 128 文字以内のキーと、256 文字以内の値が必要です。 たとえば、テンプレートの種類の既定のエクスペリエンスは、"defaultExperience": "Cassandra" に設定されます。 現在の "defaultExperience" 値には、"Table"、"Graph"、"DocumentDB"、"MongoDB" も含まれます。 タグの名前と値のディクショナリ。 「テンプレート内のタグ」を参照してください
properties Azure Cosmos DB MongoDB コレクションを作成および更新するためのプロパティ。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl... (必須)

MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl...

名前 説明
options 要求に適用するオプションのキーと値のペア。 これは、要求と共に送信されるヘッダーに対応します。 CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...
resource MongoDB コレクションの標準 JSON 形式 MongoDBCollectionResourceOrMongoDBCollectionGetPrope... (必須)

CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...

名前 説明
autoscaleSettings 自動スケーリング設定を指定します。 注: スループットまたは autoscaleSettings が必要ですが、両方は必要ありません。 AutoscaleSettings
throughput 1 秒あたりの要求ユニット数。 たとえば、"throughput": 10000 です。 INT

AutoscaleSettings

名前 説明
maxThroughput リソースがスケールアップできる最大スループットを表します。 INT

MongoDBCollectionResourceOrMongoDBCollectionGetPrope...

名前 説明
analyticalStorageTtl 分析 TTL。 INT
createMode リソースの作成モードを示す列挙型。 'Default'
'Restore'
id Cosmos DB MongoDB コレクションの名前 string (必須)
インデックス インデックス キーの一覧 MongoIndex[]
restoreParameters 復元に関する情報を示すパラメーター ResourceRestoreParameters
shardKey 要求に適用されるシャード キーのキーと値のペア。 ShardKeys

MongoIndex

名前 説明
キー Cosmos DB MongoDB コレクションのインデックス キー MongoIndexKeys
options Cosmos DB MongoDB コレクションのインデックス キー オプション MongoIndexOptions

MongoIndexKeys

名前 説明
キー Azure Cosmos DB サービス内の各 MongoDB コレクションのキーの一覧 string[]

MongoIndexOptions

名前 説明
expireAfterSeconds 秒後に有効期限が切れる INT
unique 一意かどうか [bool]

ResourceRestoreParameters

名前 説明
restoreSource 復元を開始する必要がある復元可能なデータベース アカウントの ID。 例: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} string
restoreTimestampInUtc アカウントを復元する必要がある時間 (ISO-8601 形式)。 string

ShardKeys

名前 説明
{カスタマイズされたプロパティ} string

クイック スタート テンプレート

次のクイックスタート テンプレートでは、このリソースの種類をデプロイします。

Template 説明
MongoDB API 用の Azure Cosmos アカウントを作成する

Azure にデプロイする
このテンプレートでは、2 つのコレクションで共有スループットと専用スループットを使用して、MongoDB API 4.2 用の Azure Cosmos DB アカウントを 2 つのリージョンに作成します。
MongoDB API 自動スケーリング用の Azure Cosmos アカウントを作成する

Azure にデプロイする
このテンプレートは、共有と専用の自動スケーリングスループットの両方を使用して、2 つのリージョンに MongoDB API 4.2 用の Azure Cosmos DB アカウントを作成します。

Terraform (AzAPI プロバイダー) リソース定義

databaseAccounts/mongodbDatabases/collections リソースの種類は、次を対象とする操作でデプロイできます。

  • リソース グループ

各 API バージョンの変更されたプロパティの一覧については、「 変更ログ」を参照してください。

リソース形式

Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections リソースを作成するには、次の Terraform をテンプレートに追加します。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2024-05-15"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      options = {
        autoscaleSettings = {
          maxThroughput = int
        }
        throughput = int
      }
      resource = {
        analyticalStorageTtl = int
        createMode = "string"
        id = "string"
        indexes = [
          {
            key = {
              keys = [
                "string"
              ]
            }
            options = {
              expireAfterSeconds = int
              unique = bool
            }
          }
        ]
        restoreParameters = {
          restoreSource = "string"
          restoreTimestampInUtc = "string"
        }
        shardKey = {
          {customized property} = "string"
        }
      }
    }
  })
}

プロパティ値

databaseAccounts/mongodbDatabases/collections

名前 説明
type リソースの種類 "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/collections@2024-05-15"
name リソース名 string (必須)
location リソースが属しているリソース グループの場所。 string
parent_id このリソースの親であるリソースの ID。 種類のリソースの ID: mongodbDatabases
tags タグは、リソースを記述するキーと値のペアの一覧です。 これらのタグはリソース グループをまたがってこのリソースを表示およびグループ化する際に使用できます。 リソースには最大 15 個のタグを指定できます。 各タグには 128 文字以内のキーと、256 文字以内の値が必要です。 たとえば、テンプレートの種類の既定のエクスペリエンスは"defaultExperience": "Cassandra" に設定されます。 現在の "defaultExperience" 値には、"Table"、"Graph"、"DocumentDB"、"MongoDB" も含まれます。 タグ名と値のディクショナリ。
properties Azure Cosmos DB MongoDB コレクションを作成および更新するためのプロパティ。 MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl... (必須)

MongoDBCollectionCreateUpdatePropertiesOrMongoDBColl...

名前 説明
options 要求に適用するオプションのキーと値のペア。 これは、要求と共に送信されるヘッダーに対応します。 CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...
resource MongoDB コレクションの標準 JSON 形式 MongoDBCollectionResourceOrMongoDBCollectionGetPrope... (必須)

CreateUpdateOptionsOrMongoDBCollectionGetPropertiesO...

名前 説明
autoscaleSettings 自動スケーリングの設定を指定します。 注: スループットまたは自動scaleSettings は必須ですが、両方は必要ありません。 AutoscaleSettings
throughput 1 秒あたりの要求ユニット数。 たとえば、"throughput": 10000 です。 INT

AutoscaleSettings

名前 説明
maxThroughput リソースをスケールアップできる最大スループットを表します。 INT

MongoDBCollectionResourceOrMongoDBCollectionGetPrope...

名前 説明
analyticalStorageTtl 分析 TTL。 INT
createMode リソースの作成モードを示す列挙型。 "Default"
"復元"
id Cosmos DB MongoDB コレクションの名前 string (必須)
インデックス インデックス キーの一覧 MongoIndex[]
restoreParameters 復元に関する情報を示すパラメーター ResourceRestoreParameters
shardKey 要求に適用されるシャード キーのキーと値のペア。 ShardKeys

MongoIndex

名前 説明
キー Cosmos DB MongoDB コレクションのインデックス キー MongoIndexKeys
options Cosmos DB MongoDB コレクションのインデックス キー オプション MongoIndexOptions

MongoIndexKeys

名前 説明
キー Azure Cosmos DB サービス内の各 MongoDB コレクションのキーの一覧 string[]

MongoIndexOptions

名前 説明
expireAfterSeconds 秒後に有効期限が切れる INT
unique 一意かどうか [bool]

ResourceRestoreParameters

名前 説明
restoreSource 復元を開始する必要がある復元可能なデータベース アカウントの ID。 例: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} string
restoreTimestampInUtc アカウントを復元する必要がある時間 (ISO-8601 形式)。 string

ShardKeys

名前 説明
{カスタマイズされたプロパティ} string