mongo_clusters
Creates, updates, deletes, gets or lists a mongo_clusters resource.
Overview
| Name | mongo_clusters |
| Type | Resource |
| Id | azure.mongo_cluster.mongo_clusters |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_resource_group
- check_name_availability
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
administrator | object | The local administrator properties for the mongo cluster. |
authConfig | object | The authentication configuration for the cluster. |
backup | object | The backup properties of the mongo cluster. |
clusterStatus | string | The status of the mongo cluster. Known values are: "Ready", "Provisioning", "Updating", "Starting", "Stopping", "Stopped", and "Dropping". (Ready, Provisioning, Updating, Starting, Stopping, Stopped, Dropping) |
compute | object | The compute properties of the mongo cluster. |
connectionString | string | The default mongo connection string for the cluster. |
createMode | string | The mode to create a mongo cluster. Known values are: "Default", "PointInTimeRestore", "GeoReplica", and "Replica". (Default, PointInTimeRestore, GeoReplica, Replica) |
dataApi | object | The Data API properties of the mongo cluster. |
encryption | object | The encryption configuration for the cluster. Depends on identity being configured. |
highAvailability | object | The high availability properties of the mongo cluster. |
identity | object | The managed service identities assigned to this resource. |
infrastructureVersion | string | The infrastructure version the cluster is provisioned on. |
location | string | The geo-location where the resource lives. Required. |
networkBypassMode | string | The network bypass mode for the cluster. Setting to 'AzureCosmosDB' allows Azure Cosmos DB service to bypass network restrictions. Known values are: "None" and "AzureCosmosDB". (None, AzureCosmosDB) |
previewFeatures | array | List of private endpoint connections. |
privateEndpointConnections | array | List of private endpoint connections. |
provisioningState | string | The provisioning state of the mongo cluster. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", "Updating", and "Dropping". (Succeeded, Failed, Canceled, InProgress, Updating, Dropping) |
publicNetworkAccess | string | Whether or not public endpoint access is allowed for this mongo cluster. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
replica | object | The replication properties for the mongo cluster. |
replicaParameters | object | The parameters to create a replica mongo cluster. |
restoreParameters | object | The parameters to create a point-in-time restore mongo cluster. |
serverVersion | string | The Mongo DB server version. Defaults to the latest available version if not specified. |
sharding | object | The sharding properties of the mongo cluster. |
storage | object | The storage properties of the mongo cluster. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
administrator | object | The local administrator properties for the mongo cluster. |
authConfig | object | The authentication configuration for the cluster. |
backup | object | The backup properties of the mongo cluster. |
clusterStatus | string | The status of the mongo cluster. Known values are: "Ready", "Provisioning", "Updating", "Starting", "Stopping", "Stopped", and "Dropping". (Ready, Provisioning, Updating, Starting, Stopping, Stopped, Dropping) |
compute | object | The compute properties of the mongo cluster. |
connectionString | string | The default mongo connection string for the cluster. |
createMode | string | The mode to create a mongo cluster. Known values are: "Default", "PointInTimeRestore", "GeoReplica", and "Replica". (Default, PointInTimeRestore, GeoReplica, Replica) |
dataApi | object | The Data API properties of the mongo cluster. |
encryption | object | The encryption configuration for the cluster. Depends on identity being configured. |
highAvailability | object | The high availability properties of the mongo cluster. |
identity | object | The managed service identities assigned to this resource. |
infrastructureVersion | string | The infrastructure version the cluster is provisioned on. |
location | string | The geo-location where the resource lives. Required. |
networkBypassMode | string | The network bypass mode for the cluster. Setting to 'AzureCosmosDB' allows Azure Cosmos DB service to bypass network restrictions. Known values are: "None" and "AzureCosmosDB". (None, AzureCosmosDB) |
previewFeatures | array | List of private endpoint connections. |
privateEndpointConnections | array | List of private endpoint connections. |
provisioningState | string | The provisioning state of the mongo cluster. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", "Updating", and "Dropping". (Succeeded, Failed, Canceled, InProgress, Updating, Dropping) |
publicNetworkAccess | string | Whether or not public endpoint access is allowed for this mongo cluster. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
replica | object | The replication properties for the mongo cluster. |
replicaParameters | object | The parameters to create a replica mongo cluster. |
restoreParameters | object | The parameters to create a point-in-time restore mongo cluster. |
serverVersion | string | The Mongo DB server version. Defaults to the latest available version if not specified. |
sharding | object | The sharding properties of the mongo cluster. |
storage | object | The storage properties of the mongo cluster. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
| Name | Datatype | Description |
|---|---|---|
message | string | Detailed reason why the given name is not available. |
nameAvailable | boolean | Indicates if the resource name is available. |
reason | string | The reason why the given name is not available. Known values are: "Invalid" and "AlreadyExists". (Invalid, AlreadyExists) |
| Name | Datatype | Description |
|---|---|---|
id | string | Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. |
name | string | The name of the resource. |
administrator | object | The local administrator properties for the mongo cluster. |
authConfig | object | The authentication configuration for the cluster. |
backup | object | The backup properties of the mongo cluster. |
clusterStatus | string | The status of the mongo cluster. Known values are: "Ready", "Provisioning", "Updating", "Starting", "Stopping", "Stopped", and "Dropping". (Ready, Provisioning, Updating, Starting, Stopping, Stopped, Dropping) |
compute | object | The compute properties of the mongo cluster. |
connectionString | string | The default mongo connection string for the cluster. |
createMode | string | The mode to create a mongo cluster. Known values are: "Default", "PointInTimeRestore", "GeoReplica", and "Replica". (Default, PointInTimeRestore, GeoReplica, Replica) |
dataApi | object | The Data API properties of the mongo cluster. |
encryption | object | The encryption configuration for the cluster. Depends on identity being configured. |
highAvailability | object | The high availability properties of the mongo cluster. |
identity | object | The managed service identities assigned to this resource. |
infrastructureVersion | string | The infrastructure version the cluster is provisioned on. |
location | string | The geo-location where the resource lives. Required. |
networkBypassMode | string | The network bypass mode for the cluster. Setting to 'AzureCosmosDB' allows Azure Cosmos DB service to bypass network restrictions. Known values are: "None" and "AzureCosmosDB". (None, AzureCosmosDB) |
previewFeatures | array | List of private endpoint connections. |
privateEndpointConnections | array | List of private endpoint connections. |
provisioningState | string | The provisioning state of the mongo cluster. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", "Updating", and "Dropping". (Succeeded, Failed, Canceled, InProgress, Updating, Dropping) |
publicNetworkAccess | string | Whether or not public endpoint access is allowed for this mongo cluster. Known values are: "Enabled" and "Disabled". (Enabled, Disabled) |
replica | object | The replication properties for the mongo cluster. |
replicaParameters | object | The parameters to create a replica mongo cluster. |
restoreParameters | object | The parameters to create a point-in-time restore mongo cluster. |
serverVersion | string | The Mongo DB server version. Defaults to the latest available version if not specified. |
sharding | object | The sharding properties of the mongo cluster. |
storage | object | The storage properties of the mongo cluster. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
tags | object | Resource tags. |
type | string | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | resource_group_name, mongo_cluster_name, subscription_id | Gets information about a mongo cluster. | |
list_by_resource_group | select | resource_group_name, subscription_id | List all the mongo clusters in a given resource group. | |
check_name_availability | select | location, subscription_id | Check if mongo cluster name is available for use. | |
list | select | subscription_id | List all the mongo clusters in a given subscription. | |
create_or_update | insert | resource_group_name, mongo_cluster_name, subscription_id, location | Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH. | |
update | update | resource_group_name, mongo_cluster_name, subscription_id | Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition. | |
create_or_update | replace | resource_group_name, mongo_cluster_name, subscription_id, location | Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH. | |
delete | delete | resource_group_name, mongo_cluster_name, subscription_id | Deletes a mongo cluster. | |
list_connection_strings | exec | resource_group_name, mongo_cluster_name, subscription_id | List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster. | |
promote | exec | resource_group_name, mongo_cluster_name, subscription_id, promoteOption | Promotes a replica mongo cluster to a primary role. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
location | string | The name of the Azure region. Required. |
mongo_cluster_name | string | The name of the mongo cluster. Required. |
resource_group_name | string | The name of the resource group. The name is case insensitive. Required. |
subscription_id | string |
SELECT examples
- get
- list_by_resource_group
- check_name_availability
- list
Gets information about a mongo cluster.
SELECT
id,
name,
administrator,
authConfig,
backup,
clusterStatus,
compute,
connectionString,
createMode,
dataApi,
encryption,
highAvailability,
identity,
infrastructureVersion,
location,
networkBypassMode,
previewFeatures,
privateEndpointConnections,
provisioningState,
publicNetworkAccess,
replica,
replicaParameters,
restoreParameters,
serverVersion,
sharding,
storage,
systemData,
tags,
type
FROM azure.mongo_cluster.mongo_clusters
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND mongo_cluster_name = '{{ mongo_cluster_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
List all the mongo clusters in a given resource group.
SELECT
id,
name,
administrator,
authConfig,
backup,
clusterStatus,
compute,
connectionString,
createMode,
dataApi,
encryption,
highAvailability,
identity,
infrastructureVersion,
location,
networkBypassMode,
previewFeatures,
privateEndpointConnections,
provisioningState,
publicNetworkAccess,
replica,
replicaParameters,
restoreParameters,
serverVersion,
sharding,
storage,
systemData,
tags,
type
FROM azure.mongo_cluster.mongo_clusters
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
Check if mongo cluster name is available for use.
SELECT
message,
nameAvailable,
reason
FROM azure.mongo_cluster.mongo_clusters
WHERE location = '{{ location }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
List all the mongo clusters in a given subscription.
SELECT
id,
name,
administrator,
authConfig,
backup,
clusterStatus,
compute,
connectionString,
createMode,
dataApi,
encryption,
highAvailability,
identity,
infrastructureVersion,
location,
networkBypassMode,
previewFeatures,
privateEndpointConnections,
provisioningState,
publicNetworkAccess,
replica,
replicaParameters,
restoreParameters,
serverVersion,
sharding,
storage,
systemData,
tags,
type
FROM azure.mongo_cluster.mongo_clusters
WHERE subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH.
INSERT INTO azure.mongo_cluster.mongo_clusters (
tags,
location,
properties,
identity,
resource_group_name,
mongo_cluster_name,
subscription_id
)
SELECT
'{{ tags }}',
'{{ location }}' /* required */,
'{{ properties }}',
'{{ identity }}',
'{{ resource_group_name }}',
'{{ mongo_cluster_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type
;
# Description fields are for documentation purposes
- name: mongo_clusters
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the mongo_clusters resource.
- name: mongo_cluster_name
value: "{{ mongo_cluster_name }}"
description: Required parameter for the mongo_clusters resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the mongo_clusters resource.
- name: tags
value: "{{ tags }}"
description: |
Resource tags.
- name: location
value: "{{ location }}"
description: |
The geo-location where the resource lives. Required.
- name: properties
description: |
The resource-specific properties for this resource.
value:
createMode: "{{ createMode }}"
restoreParameters:
pointInTimeUTC: "{{ pointInTimeUTC }}"
sourceResourceId: "{{ sourceResourceId }}"
replicaParameters:
sourceResourceId: "{{ sourceResourceId }}"
sourceLocation: "{{ sourceLocation }}"
administrator:
userName: "{{ userName }}"
password: "{{ password }}"
serverVersion: "{{ serverVersion }}"
connectionString: "{{ connectionString }}"
provisioningState: "{{ provisioningState }}"
clusterStatus: "{{ clusterStatus }}"
publicNetworkAccess: "{{ publicNetworkAccess }}"
highAvailability:
targetMode: "{{ targetMode }}"
storage:
sizeGb: {{ sizeGb }}
type: "{{ type }}"
sharding:
shardCount: {{ shardCount }}
compute:
tier: "{{ tier }}"
backup:
earliestRestoreTime: "{{ earliestRestoreTime }}"
dataApi:
mode: "{{ mode }}"
privateEndpointConnections:
- id: "{{ id }}"
name: "{{ name }}"
type: "{{ type }}"
systemData:
createdBy: "{{ createdBy }}"
createdByType: "{{ createdByType }}"
createdAt: "{{ createdAt }}"
lastModifiedBy: "{{ lastModifiedBy }}"
lastModifiedByType: "{{ lastModifiedByType }}"
lastModifiedAt: "{{ lastModifiedAt }}"
properties:
groupIds:
- "{{ groupIds }}"
privateEndpoint:
id: "{{ id }}"
privateLinkServiceConnectionState:
status: "{{ status }}"
description: "{{ description }}"
actionsRequired: "{{ actionsRequired }}"
provisioningState: "{{ provisioningState }}"
previewFeatures:
- "{{ previewFeatures }}"
replica:
sourceResourceId: "{{ sourceResourceId }}"
role: "{{ role }}"
replicationState: "{{ replicationState }}"
infrastructureVersion: "{{ infrastructureVersion }}"
authConfig:
allowedModes:
- "{{ allowedModes }}"
encryption:
customerManagedKeyEncryption:
keyEncryptionKeyIdentity:
identityType: "{{ identityType }}"
userAssignedIdentityResourceId: "{{ userAssignedIdentityResourceId }}"
keyEncryptionKeyUrl: "{{ keyEncryptionKeyUrl }}"
networkBypassMode: "{{ networkBypassMode }}"
- name: identity
description: |
The managed service identities assigned to this resource.
value:
principalId: "{{ principalId }}"
tenantId: "{{ tenantId }}"
type: "{{ type }}"
userAssignedIdentities: "{{ userAssignedIdentities }}"
UPDATE examples
- update
Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition.
UPDATE azure.mongo_cluster.mongo_clusters
SET
identity = '{{ identity }}',
tags = '{{ tags }}',
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND mongo_cluster_name = '{{ mongo_cluster_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type;
REPLACE examples
- create_or_update
Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH.
REPLACE azure.mongo_cluster.mongo_clusters
SET
tags = '{{ tags }}',
location = '{{ location }}',
properties = '{{ properties }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND mongo_cluster_name = '{{ mongo_cluster_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND location = '{{ location }}' --required
RETURNING
id,
name,
identity,
location,
properties,
systemData,
tags,
type;
DELETE examples
- delete
Deletes a mongo cluster.
DELETE FROM azure.mongo_cluster.mongo_clusters
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND mongo_cluster_name = '{{ mongo_cluster_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;
Lifecycle Methods
- list_connection_strings
- promote
List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster.
EXEC azure.mongo_cluster.mongo_clusters.list_connection_strings
@resource_group_name='{{ resource_group_name }}' --required,
@mongo_cluster_name='{{ mongo_cluster_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;
Promotes a replica mongo cluster to a primary role.
EXEC azure.mongo_cluster.mongo_clusters.promote
@resource_group_name='{{ resource_group_name }}' --required,
@mongo_cluster_name='{{ mongo_cluster_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
@@json=
'{
"promoteOption": "{{ promoteOption }}",
"mode": "{{ mode }}"
}'
;