azure-native.mongocluster.User
Explore with Pulumi AI
Represents a Mongo cluster user.
Uses Azure REST API version 2025-04-01-preview.
Other available API versions: 2025-07-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native mongocluster [ApiVersion]
. See the version guide for details.
Example Usage
Creates a user on a Mongo Cluster resource.
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var user = new AzureNative.MongoCluster.User("user", new()
{
MongoClusterName = "myMongoCluster",
Properties = new AzureNative.MongoCluster.Inputs.UserPropertiesArgs
{
IdentityProvider = new AzureNative.MongoCluster.Inputs.EntraIdentityProviderArgs
{
Properties = new AzureNative.MongoCluster.Inputs.EntraIdentityProviderPropertiesArgs
{
PrincipalType = AzureNative.MongoCluster.EntraPrincipalType.User,
},
Type = "MicrosoftEntraID",
},
Roles = new[]
{
new AzureNative.MongoCluster.Inputs.DatabaseRoleArgs
{
Db = "admin",
Role = AzureNative.MongoCluster.UserRole.DatabaseOwner,
},
},
},
ResourceGroupName = "TestGroup",
UserName = "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu",
});
});
package main
import (
mongocluster "github.com/pulumi/pulumi-azure-native-sdk/mongocluster/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := mongocluster.NewUser(ctx, "user", &mongocluster.UserArgs{
MongoClusterName: pulumi.String("myMongoCluster"),
Properties: &mongocluster.UserPropertiesArgs{
IdentityProvider: &mongocluster.EntraIdentityProviderArgs{
Properties: &mongocluster.EntraIdentityProviderPropertiesArgs{
PrincipalType: pulumi.String(mongocluster.EntraPrincipalTypeUser),
},
Type: pulumi.String("MicrosoftEntraID"),
},
Roles: mongocluster.DatabaseRoleArray{
&mongocluster.DatabaseRoleArgs{
Db: pulumi.String("admin"),
Role: pulumi.String(mongocluster.UserRoleDatabaseOwner),
},
},
},
ResourceGroupName: pulumi.String("TestGroup"),
UserName: pulumi.String("uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.mongocluster.User;
import com.pulumi.azurenative.mongocluster.UserArgs;
import com.pulumi.azurenative.mongocluster.inputs.UserPropertiesArgs;
import com.pulumi.azurenative.mongocluster.inputs.EntraIdentityProviderArgs;
import com.pulumi.azurenative.mongocluster.inputs.EntraIdentityProviderPropertiesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var user = new User("user", UserArgs.builder()
.mongoClusterName("myMongoCluster")
.properties(UserPropertiesArgs.builder()
.identityProvider(Map.ofEntries(
Map.entry("properties", EntraIdentityProviderPropertiesArgs.builder()
.principalType("user")
.build()),
Map.entry("type", "MicrosoftEntraID")
))
.roles(DatabaseRoleArgs.builder()
.db("admin")
.role("dbOwner")
.build())
.build())
.resourceGroupName("TestGroup")
.userName("uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const user = new azure_native.mongocluster.User("user", {
mongoClusterName: "myMongoCluster",
properties: {
identityProvider: {
properties: {
principalType: azure_native.mongocluster.EntraPrincipalType.User,
},
type: "MicrosoftEntraID",
},
roles: [{
db: "admin",
role: azure_native.mongocluster.UserRole.DatabaseOwner,
}],
},
resourceGroupName: "TestGroup",
userName: "uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu",
});
import pulumi
import pulumi_azure_native as azure_native
user = azure_native.mongocluster.User("user",
mongo_cluster_name="myMongoCluster",
properties={
"identity_provider": {
"properties": {
"principal_type": azure_native.mongocluster.EntraPrincipalType.USER,
},
"type": "MicrosoftEntraID",
},
"roles": [{
"db": "admin",
"role": azure_native.mongocluster.UserRole.DATABASE_OWNER,
}],
},
resource_group_name="TestGroup",
user_name="uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu")
resources:
user:
type: azure-native:mongocluster:User
properties:
mongoClusterName: myMongoCluster
properties:
identityProvider:
properties:
principalType: user
type: MicrosoftEntraID
roles:
- db: admin
role: dbOwner
resourceGroupName: TestGroup
userName: uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu
Create User Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: str,
args: UserArgs,
opts: Optional[ResourceOptions] = None)
@overload
def User(resource_name: str,
opts: Optional[ResourceOptions] = None,
mongo_cluster_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
properties: Optional[UserPropertiesArgs] = None,
user_name: Optional[str] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
type: azure-native:mongocluster:User
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var exampleuserResourceResourceFromMongocluster = new AzureNative.MongoCluster.User("exampleuserResourceResourceFromMongocluster", new()
{
MongoClusterName = "string",
ResourceGroupName = "string",
Properties = new AzureNative.MongoCluster.Inputs.UserPropertiesArgs
{
IdentityProvider = new AzureNative.MongoCluster.Inputs.EntraIdentityProviderArgs
{
Properties = new AzureNative.MongoCluster.Inputs.EntraIdentityProviderPropertiesArgs
{
PrincipalType = "string",
},
Type = "MicrosoftEntraID",
},
Roles = new[]
{
new AzureNative.MongoCluster.Inputs.DatabaseRoleArgs
{
Db = "string",
Role = "string",
},
},
},
UserName = "string",
});
example, err := mongocluster.NewUser(ctx, "exampleuserResourceResourceFromMongocluster", &mongocluster.UserArgs{
MongoClusterName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
Properties: &mongocluster.UserPropertiesArgs{
IdentityProvider: &mongocluster.EntraIdentityProviderArgs{
Properties: &mongocluster.EntraIdentityProviderPropertiesArgs{
PrincipalType: pulumi.String("string"),
},
Type: pulumi.String("MicrosoftEntraID"),
},
Roles: mongocluster.DatabaseRoleArray{
&mongocluster.DatabaseRoleArgs{
Db: pulumi.String("string"),
Role: pulumi.String("string"),
},
},
},
UserName: pulumi.String("string"),
})
var exampleuserResourceResourceFromMongocluster = new com.pulumi.azurenative.mongocluster.User("exampleuserResourceResourceFromMongocluster", com.pulumi.azurenative.mongocluster.UserArgs.builder()
.mongoClusterName("string")
.resourceGroupName("string")
.properties(UserPropertiesArgs.builder()
.identityProvider(Map.ofEntries(
Map.entry("properties", EntraIdentityProviderPropertiesArgs.builder()
.principalType("string")
.build()),
Map.entry("type", "MicrosoftEntraID")
))
.roles(DatabaseRoleArgs.builder()
.db("string")
.role("string")
.build())
.build())
.userName("string")
.build());
exampleuser_resource_resource_from_mongocluster = azure_native.mongocluster.User("exampleuserResourceResourceFromMongocluster",
mongo_cluster_name="string",
resource_group_name="string",
properties={
"identity_provider": {
"properties": {
"principal_type": "string",
},
"type": "MicrosoftEntraID",
},
"roles": [{
"db": "string",
"role": "string",
}],
},
user_name="string")
const exampleuserResourceResourceFromMongocluster = new azure_native.mongocluster.User("exampleuserResourceResourceFromMongocluster", {
mongoClusterName: "string",
resourceGroupName: "string",
properties: {
identityProvider: {
properties: {
principalType: "string",
},
type: "MicrosoftEntraID",
},
roles: [{
db: "string",
role: "string",
}],
},
userName: "string",
});
type: azure-native:mongocluster:User
properties:
mongoClusterName: string
properties:
identityProvider:
properties:
principalType: string
type: MicrosoftEntraID
roles:
- db: string
role: string
resourceGroupName: string
userName: string
User Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The User resource accepts the following input properties:
- Mongo
Cluster stringName - The name of the mongo cluster.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Properties
Pulumi.
Azure Native. Mongo Cluster. Inputs. User Properties - The resource-specific properties for this resource.
- User
Name string - The name of the mongo cluster user.
- Mongo
Cluster stringName - The name of the mongo cluster.
- Resource
Group stringName - The name of the resource group. The name is case insensitive.
- Properties
User
Properties Args - The resource-specific properties for this resource.
- User
Name string - The name of the mongo cluster user.
- mongo
Cluster StringName - The name of the mongo cluster.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- properties
User
Properties - The resource-specific properties for this resource.
- user
Name String - The name of the mongo cluster user.
- mongo
Cluster stringName - The name of the mongo cluster.
- resource
Group stringName - The name of the resource group. The name is case insensitive.
- properties
User
Properties - The resource-specific properties for this resource.
- user
Name string - The name of the mongo cluster user.
- mongo_
cluster_ strname - The name of the mongo cluster.
- resource_
group_ strname - The name of the resource group. The name is case insensitive.
- properties
User
Properties Args - The resource-specific properties for this resource.
- user_
name str - The name of the mongo cluster user.
- mongo
Cluster StringName - The name of the mongo cluster.
- resource
Group StringName - The name of the resource group. The name is case insensitive.
- properties Property Map
- The resource-specific properties for this resource.
- user
Name String - The name of the mongo cluster user.
Outputs
All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:
- Azure
Api stringVersion - The Azure API version of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource
- System
Data Pulumi.Azure Native. Mongo Cluster. Outputs. System Data Response - 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"
- Azure
Api stringVersion - The Azure API version of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the resource
- System
Data SystemData Response - 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"
- azure
Api StringVersion - The Azure API version of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource
- system
Data SystemData Response - 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"
- azure
Api stringVersion - The Azure API version of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the resource
- system
Data SystemData Response - 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"
- azure_
api_ strversion - The Azure API version of the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the resource
- system_
data SystemData Response - Azure Resource Manager metadata containing createdBy and modifiedBy information.
- type str
- The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
- azure
Api StringVersion - The Azure API version of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the resource
- system
Data Property Map - 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"
Supporting Types
DatabaseRole, DatabaseRoleArgs
- Db string
- Database scope that the role is assigned to.
- Role
string | Pulumi.
Azure Native. Mongo Cluster. User Role - The role that is assigned to the user on the database scope.
DatabaseRoleResponse, DatabaseRoleResponseArgs
EntraIdentityProvider, EntraIdentityProviderArgs
- Properties
Pulumi.
Azure Native. Mongo Cluster. Inputs. Entra Identity Provider Properties - The Entra identity properties for the user.
- Properties
Entra
Identity Provider Properties - The Entra identity properties for the user.
- properties
Entra
Identity Provider Properties - The Entra identity properties for the user.
- properties
Entra
Identity Provider Properties - The Entra identity properties for the user.
- properties
Entra
Identity Provider Properties - The Entra identity properties for the user.
- properties Property Map
- The Entra identity properties for the user.
EntraIdentityProviderProperties, EntraIdentityProviderPropertiesArgs
- Principal
Type string | Pulumi.Azure Native. Mongo Cluster. Entra Principal Type - The principal type of the user.
- Principal
Type string | EntraPrincipal Type - The principal type of the user.
- principal
Type String | EntraPrincipal Type - The principal type of the user.
- principal
Type string | EntraPrincipal Type - The principal type of the user.
- principal_
type str | EntraPrincipal Type - The principal type of the user.
- principal
Type String | "user" | "servicePrincipal" - The principal type of the user.
EntraIdentityProviderPropertiesResponse, EntraIdentityProviderPropertiesResponseArgs
- Principal
Type string - The principal type of the user.
- Principal
Type string - The principal type of the user.
- principal
Type String - The principal type of the user.
- principal
Type string - The principal type of the user.
- principal_
type str - The principal type of the user.
- principal
Type String - The principal type of the user.
EntraIdentityProviderResponse, EntraIdentityProviderResponseArgs
- Properties
Pulumi.
Azure Native. Mongo Cluster. Inputs. Entra Identity Provider Properties Response - The Entra identity properties for the user.
- Properties
Entra
Identity Provider Properties Response - The Entra identity properties for the user.
- properties
Entra
Identity Provider Properties Response - The Entra identity properties for the user.
- properties
Entra
Identity Provider Properties Response - The Entra identity properties for the user.
- properties
Entra
Identity Provider Properties Response - The Entra identity properties for the user.
- properties Property Map
- The Entra identity properties for the user.
EntraPrincipalType, EntraPrincipalTypeArgs
- User
- userEntra user type.
- Service
Principal - servicePrincipalEntra service principal type.
- Entra
Principal Type User - userEntra user type.
- Entra
Principal Type Service Principal - servicePrincipalEntra service principal type.
- User
- userEntra user type.
- Service
Principal - servicePrincipalEntra service principal type.
- User
- userEntra user type.
- Service
Principal - servicePrincipalEntra service principal type.
- USER
- userEntra user type.
- SERVICE_PRINCIPAL
- servicePrincipalEntra service principal type.
- "user"
- userEntra user type.
- "service
Principal" - servicePrincipalEntra service principal type.
SystemDataResponse, SystemDataResponseArgs
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- Created
At string - The timestamp of resource creation (UTC).
- Created
By string - The identity that created the resource.
- Created
By stringType - The type of identity that created the resource.
- Last
Modified stringAt - The timestamp of resource last modification (UTC)
- Last
Modified stringBy - The identity that last modified the resource.
- Last
Modified stringBy Type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
- created
At string - The timestamp of resource creation (UTC).
- created
By string - The identity that created the resource.
- created
By stringType - The type of identity that created the resource.
- last
Modified stringAt - The timestamp of resource last modification (UTC)
- last
Modified stringBy - The identity that last modified the resource.
- last
Modified stringBy Type - The type of identity that last modified the resource.
- created_
at str - The timestamp of resource creation (UTC).
- created_
by str - The identity that created the resource.
- created_
by_ strtype - The type of identity that created the resource.
- last_
modified_ strat - The timestamp of resource last modification (UTC)
- last_
modified_ strby - The identity that last modified the resource.
- last_
modified_ strby_ type - The type of identity that last modified the resource.
- created
At String - The timestamp of resource creation (UTC).
- created
By String - The identity that created the resource.
- created
By StringType - The type of identity that created the resource.
- last
Modified StringAt - The timestamp of resource last modification (UTC)
- last
Modified StringBy - The identity that last modified the resource.
- last
Modified StringBy Type - The type of identity that last modified the resource.
UserProperties, UserPropertiesArgs
- Identity
Provider Pulumi.Azure Native. Mongo Cluster. Inputs. Entra Identity Provider - The user's identity provider definition.
- Roles
List<Pulumi.
Azure Native. Mongo Cluster. Inputs. Database Role> - Database roles that are assigned to the user.
- Identity
Provider EntraIdentity Provider - The user's identity provider definition.
- Roles
[]Database
Role - Database roles that are assigned to the user.
- identity
Provider EntraIdentity Provider - The user's identity provider definition.
- roles
List<Database
Role> - Database roles that are assigned to the user.
- identity
Provider EntraIdentity Provider - The user's identity provider definition.
- roles
Database
Role[] - Database roles that are assigned to the user.
- identity_
provider EntraIdentity Provider - The user's identity provider definition.
- roles
Sequence[Database
Role] - Database roles that are assigned to the user.
- identity
Provider Property Map - The user's identity provider definition.
- roles List<Property Map>
- Database roles that are assigned to the user.
UserPropertiesResponse, UserPropertiesResponseArgs
- Provisioning
State string - The provisioning state of the user.
- Identity
Provider Pulumi.Azure Native. Mongo Cluster. Inputs. Entra Identity Provider Response - The user's identity provider definition.
- Roles
List<Pulumi.
Azure Native. Mongo Cluster. Inputs. Database Role Response> - Database roles that are assigned to the user.
- Provisioning
State string - The provisioning state of the user.
- Identity
Provider EntraIdentity Provider Response - The user's identity provider definition.
- Roles
[]Database
Role Response - Database roles that are assigned to the user.
- provisioning
State String - The provisioning state of the user.
- identity
Provider EntraIdentity Provider Response - The user's identity provider definition.
- roles
List<Database
Role Response> - Database roles that are assigned to the user.
- provisioning
State string - The provisioning state of the user.
- identity
Provider EntraIdentity Provider Response - The user's identity provider definition.
- roles
Database
Role Response[] - Database roles that are assigned to the user.
- provisioning_
state str - The provisioning state of the user.
- identity_
provider EntraIdentity Provider Response - The user's identity provider definition.
- roles
Sequence[Database
Role Response] - Database roles that are assigned to the user.
- provisioning
State String - The provisioning state of the user.
- identity
Provider Property Map - The user's identity provider definition.
- roles List<Property Map>
- Database roles that are assigned to the user.
UserRole, UserRoleArgs
- Database
Owner - dbOwnerDatbase owner role permissions on the target scope.
- User
Role Database Owner - dbOwnerDatbase owner role permissions on the target scope.
- Database
Owner - dbOwnerDatbase owner role permissions on the target scope.
- Database
Owner - dbOwnerDatbase owner role permissions on the target scope.
- DATABASE_OWNER
- dbOwnerDatbase owner role permissions on the target scope.
- "db
Owner" - dbOwnerDatbase owner role permissions on the target scope.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:mongocluster:User uuuuuuuu-uuuu-uuuu-uuuu-uuuuuuuuuuuu /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/users/{userName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0