users
Creates, updates, deletes, gets or lists a users resource.
Overview
| Name | users |
| Type | Resource |
| Id | azure.mongo_cluster.users |
Fields
The following fields are returned by SELECT queries:
- get
- list_by_mongo_cluster
| 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. |
identityProvider | object | The user's identity provider definition. |
provisioningState | string | The provisioning state of the user. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", "Updating", and "Dropping". (Succeeded, Failed, Canceled, InProgress, Updating, Dropping) |
roles | array | Database roles that are assigned to the user. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
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. |
identityProvider | object | The user's identity provider definition. |
provisioningState | string | The provisioning state of the user. Known values are: "Succeeded", "Failed", "Canceled", "InProgress", "Updating", and "Dropping". (Succeeded, Failed, Canceled, InProgress, Updating, Dropping) |
roles | array | Database roles that are assigned to the user. |
systemData | object | Azure Resource Manager metadata containing createdBy and modifiedBy information. |
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, user_name, subscription_id | Gets the defintion of a Mongo cluster user. | |
list_by_mongo_cluster | select | resource_group_name, mongo_cluster_name, subscription_id | List all the users on a mongo cluster. | |
create_or_update | insert | resource_group_name, mongo_cluster_name, user_name, subscription_id | Creates a new user or updates an existing user on a mongo cluster. | |
create_or_update | replace | resource_group_name, mongo_cluster_name, user_name, subscription_id | Creates a new user or updates an existing user on a mongo cluster. | |
delete | delete | resource_group_name, mongo_cluster_name, user_name, subscription_id | Deletes a mongo cluster user. |
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 |
|---|---|---|
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 | |
user_name | string | The name of the mongo cluster user. Required. |
SELECT examples
- get
- list_by_mongo_cluster
Gets the defintion of a Mongo cluster user.
SELECT
id,
name,
identityProvider,
provisioningState,
roles,
systemData,
type
FROM azure.mongo_cluster.users
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND mongo_cluster_name = '{{ mongo_cluster_name }}' -- required
AND user_name = '{{ user_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
List all the users on a mongo cluster.
SELECT
id,
name,
identityProvider,
provisioningState,
roles,
systemData,
type
FROM azure.mongo_cluster.users
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND mongo_cluster_name = '{{ mongo_cluster_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;
INSERT examples
- create_or_update
- Manifest
Creates a new user or updates an existing user on a mongo cluster.
INSERT INTO azure.mongo_cluster.users (
properties,
resource_group_name,
mongo_cluster_name,
user_name,
subscription_id
)
SELECT
'{{ properties }}',
'{{ resource_group_name }}',
'{{ mongo_cluster_name }}',
'{{ user_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;
# Description fields are for documentation purposes
- name: users
props:
- name: resource_group_name
value: "{{ resource_group_name }}"
description: Required parameter for the users resource.
- name: mongo_cluster_name
value: "{{ mongo_cluster_name }}"
description: Required parameter for the users resource.
- name: user_name
value: "{{ user_name }}"
description: Required parameter for the users resource.
- name: subscription_id
value: "{{ subscription_id }}"
description: Required parameter for the users resource.
- name: properties
description: |
The resource-specific properties for this resource.
value:
provisioningState: "{{ provisioningState }}"
identityProvider:
type: "{{ type }}"
roles:
- db: "{{ db }}"
role: "{{ role }}"
REPLACE examples
- create_or_update
Creates a new user or updates an existing user on a mongo cluster.
REPLACE azure.mongo_cluster.users
SET
properties = '{{ properties }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND mongo_cluster_name = '{{ mongo_cluster_name }}' --required
AND user_name = '{{ user_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;
DELETE examples
- delete
Deletes a mongo cluster user.
DELETE FROM azure.mongo_cluster.users
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND mongo_cluster_name = '{{ mongo_cluster_name }}' --required
AND user_name = '{{ user_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;