1. Packages
  2. Scaleway
  3. API Docs
  4. mongodb
  5. User
Viewing docs for Scaleway v1.44.1
published on Monday, Mar 9, 2026 by pulumiverse
scaleway logo
Viewing docs for Scaleway v1.44.1
published on Monday, Mar 9, 2026 by pulumiverse

    Manages MongoDB users. For more information, see the documentation.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    //## Basic user creation
    const main = new scaleway.mongodb.Instance("main", {
        name: "test-mongodb-user",
        version: "7.0.12",
        nodeType: "MGDB-PLAY2-NANO",
        nodeNumber: 1,
        userName: "initial_user",
        password: "initial_password123",
        volumeSizeInGb: 5,
    });
    const mainUser = new scaleway.mongodb.User("main", {
        instanceId: main.id,
        name: "my_user",
        password: "my_password123",
        roles: [{
            role: "read_write",
            databaseName: "my_database",
        }],
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    ### Basic user creation
    main = scaleway.mongodb.Instance("main",
        name="test-mongodb-user",
        version="7.0.12",
        node_type="MGDB-PLAY2-NANO",
        node_number=1,
        user_name="initial_user",
        password="initial_password123",
        volume_size_in_gb=5)
    main_user = scaleway.mongodb.User("main",
        instance_id=main.id,
        name="my_user",
        password="my_password123",
        roles=[{
            "role": "read_write",
            "database_name": "my_database",
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/mongodb"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// ## Basic user creation
    		main, err := mongodb.NewInstance(ctx, "main", &mongodb.InstanceArgs{
    			Name:           pulumi.String("test-mongodb-user"),
    			Version:        pulumi.String("7.0.12"),
    			NodeType:       pulumi.String("MGDB-PLAY2-NANO"),
    			NodeNumber:     pulumi.Int(1),
    			UserName:       pulumi.String("initial_user"),
    			Password:       pulumi.String("initial_password123"),
    			VolumeSizeInGb: pulumi.Int(5),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = mongodb.NewUser(ctx, "main", &mongodb.UserArgs{
    			InstanceId: main.ID(),
    			Name:       pulumi.String("my_user"),
    			Password:   pulumi.String("my_password123"),
    			Roles: mongodb.UserRoleArray{
    				&mongodb.UserRoleArgs{
    					Role:         pulumi.String("read_write"),
    					DatabaseName: pulumi.String("my_database"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        //## Basic user creation
        var main = new Scaleway.Mongodb.Instance("main", new()
        {
            Name = "test-mongodb-user",
            Version = "7.0.12",
            NodeType = "MGDB-PLAY2-NANO",
            NodeNumber = 1,
            UserName = "initial_user",
            Password = "initial_password123",
            VolumeSizeInGb = 5,
        });
    
        var mainUser = new Scaleway.Mongodb.User("main", new()
        {
            InstanceId = main.Id,
            Name = "my_user",
            Password = "my_password123",
            Roles = new[]
            {
                new Scaleway.Mongodb.Inputs.UserRoleArgs
                {
                    Role = "read_write",
                    DatabaseName = "my_database",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.mongodb.Instance;
    import com.pulumi.scaleway.mongodb.InstanceArgs;
    import com.pulumi.scaleway.mongodb.User;
    import com.pulumi.scaleway.mongodb.UserArgs;
    import com.pulumi.scaleway.mongodb.inputs.UserRoleArgs;
    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) {
            //## Basic user creation
            var main = new Instance("main", InstanceArgs.builder()
                .name("test-mongodb-user")
                .version("7.0.12")
                .nodeType("MGDB-PLAY2-NANO")
                .nodeNumber(1)
                .userName("initial_user")
                .password("initial_password123")
                .volumeSizeInGb(5)
                .build());
    
            var mainUser = new User("mainUser", UserArgs.builder()
                .instanceId(main.id())
                .name("my_user")
                .password("my_password123")
                .roles(UserRoleArgs.builder()
                    .role("read_write")
                    .databaseName("my_database")
                    .build())
                .build());
    
        }
    }
    
    resources:
      ### Basic user creation
      main:
        type: scaleway:mongodb:Instance
        properties:
          name: test-mongodb-user
          version: 7.0.12
          nodeType: MGDB-PLAY2-NANO
          nodeNumber: 1
          userName: initial_user
          password: initial_password123
          volumeSizeInGb: 5
      mainUser:
        type: scaleway:mongodb:User
        name: main
        properties:
          instanceId: ${main.id}
          name: my_user
          password: my_password123
          roles:
            - role: read_write
              databaseName: my_database
    
    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    //## Multiple user creation
    const main = new scaleway.mongodb.Instance("main", {
        name: "test-mongodb-multi-user",
        version: "7.0.12",
        nodeType: "MGDB-PLAY2-NANO",
        nodeNumber: 1,
        userName: "admin_user",
        password: "admin_password123",
        volumeSizeInGb: 5,
    });
    const appUser = new scaleway.mongodb.User("app_user", {
        instanceId: main.id,
        name: "app_user",
        password: "app_password123",
        roles: [
            {
                role: "read_write",
                databaseName: "app_database",
            },
            {
                role: "read",
                databaseName: "logs_database",
            },
        ],
    });
    const adminUser = new scaleway.mongodb.User("admin_user", {
        instanceId: main.id,
        name: "admin_user",
        password: "admin_password123",
        roles: [
            {
                role: "db_admin",
                databaseName: "admin",
            },
            {
                role: "read",
                anyDatabase: true,
            },
        ],
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    ### Multiple user creation
    main = scaleway.mongodb.Instance("main",
        name="test-mongodb-multi-user",
        version="7.0.12",
        node_type="MGDB-PLAY2-NANO",
        node_number=1,
        user_name="admin_user",
        password="admin_password123",
        volume_size_in_gb=5)
    app_user = scaleway.mongodb.User("app_user",
        instance_id=main.id,
        name="app_user",
        password="app_password123",
        roles=[
            {
                "role": "read_write",
                "database_name": "app_database",
            },
            {
                "role": "read",
                "database_name": "logs_database",
            },
        ])
    admin_user = scaleway.mongodb.User("admin_user",
        instance_id=main.id,
        name="admin_user",
        password="admin_password123",
        roles=[
            {
                "role": "db_admin",
                "database_name": "admin",
            },
            {
                "role": "read",
                "any_database": True,
            },
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/mongodb"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// ## Multiple user creation
    		main, err := mongodb.NewInstance(ctx, "main", &mongodb.InstanceArgs{
    			Name:           pulumi.String("test-mongodb-multi-user"),
    			Version:        pulumi.String("7.0.12"),
    			NodeType:       pulumi.String("MGDB-PLAY2-NANO"),
    			NodeNumber:     pulumi.Int(1),
    			UserName:       pulumi.String("admin_user"),
    			Password:       pulumi.String("admin_password123"),
    			VolumeSizeInGb: pulumi.Int(5),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = mongodb.NewUser(ctx, "app_user", &mongodb.UserArgs{
    			InstanceId: main.ID(),
    			Name:       pulumi.String("app_user"),
    			Password:   pulumi.String("app_password123"),
    			Roles: mongodb.UserRoleArray{
    				&mongodb.UserRoleArgs{
    					Role:         pulumi.String("read_write"),
    					DatabaseName: pulumi.String("app_database"),
    				},
    				&mongodb.UserRoleArgs{
    					Role:         pulumi.String("read"),
    					DatabaseName: pulumi.String("logs_database"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = mongodb.NewUser(ctx, "admin_user", &mongodb.UserArgs{
    			InstanceId: main.ID(),
    			Name:       pulumi.String("admin_user"),
    			Password:   pulumi.String("admin_password123"),
    			Roles: mongodb.UserRoleArray{
    				&mongodb.UserRoleArgs{
    					Role:         pulumi.String("db_admin"),
    					DatabaseName: pulumi.String("admin"),
    				},
    				&mongodb.UserRoleArgs{
    					Role:        pulumi.String("read"),
    					AnyDatabase: pulumi.Bool(true),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        //## Multiple user creation
        var main = new Scaleway.Mongodb.Instance("main", new()
        {
            Name = "test-mongodb-multi-user",
            Version = "7.0.12",
            NodeType = "MGDB-PLAY2-NANO",
            NodeNumber = 1,
            UserName = "admin_user",
            Password = "admin_password123",
            VolumeSizeInGb = 5,
        });
    
        var appUser = new Scaleway.Mongodb.User("app_user", new()
        {
            InstanceId = main.Id,
            Name = "app_user",
            Password = "app_password123",
            Roles = new[]
            {
                new Scaleway.Mongodb.Inputs.UserRoleArgs
                {
                    Role = "read_write",
                    DatabaseName = "app_database",
                },
                new Scaleway.Mongodb.Inputs.UserRoleArgs
                {
                    Role = "read",
                    DatabaseName = "logs_database",
                },
            },
        });
    
        var adminUser = new Scaleway.Mongodb.User("admin_user", new()
        {
            InstanceId = main.Id,
            Name = "admin_user",
            Password = "admin_password123",
            Roles = new[]
            {
                new Scaleway.Mongodb.Inputs.UserRoleArgs
                {
                    Role = "db_admin",
                    DatabaseName = "admin",
                },
                new Scaleway.Mongodb.Inputs.UserRoleArgs
                {
                    Role = "read",
                    AnyDatabase = true,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.mongodb.Instance;
    import com.pulumi.scaleway.mongodb.InstanceArgs;
    import com.pulumi.scaleway.mongodb.User;
    import com.pulumi.scaleway.mongodb.UserArgs;
    import com.pulumi.scaleway.mongodb.inputs.UserRoleArgs;
    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) {
            //## Multiple user creation
            var main = new Instance("main", InstanceArgs.builder()
                .name("test-mongodb-multi-user")
                .version("7.0.12")
                .nodeType("MGDB-PLAY2-NANO")
                .nodeNumber(1)
                .userName("admin_user")
                .password("admin_password123")
                .volumeSizeInGb(5)
                .build());
    
            var appUser = new User("appUser", UserArgs.builder()
                .instanceId(main.id())
                .name("app_user")
                .password("app_password123")
                .roles(            
                    UserRoleArgs.builder()
                        .role("read_write")
                        .databaseName("app_database")
                        .build(),
                    UserRoleArgs.builder()
                        .role("read")
                        .databaseName("logs_database")
                        .build())
                .build());
    
            var adminUser = new User("adminUser", UserArgs.builder()
                .instanceId(main.id())
                .name("admin_user")
                .password("admin_password123")
                .roles(            
                    UserRoleArgs.builder()
                        .role("db_admin")
                        .databaseName("admin")
                        .build(),
                    UserRoleArgs.builder()
                        .role("read")
                        .anyDatabase(true)
                        .build())
                .build());
    
        }
    }
    
    resources:
      ### Multiple user creation
      main:
        type: scaleway:mongodb:Instance
        properties:
          name: test-mongodb-multi-user
          version: 7.0.12
          nodeType: MGDB-PLAY2-NANO
          nodeNumber: 1
          userName: admin_user
          password: admin_password123
          volumeSizeInGb: 5
      appUser:
        type: scaleway:mongodb:User
        name: app_user
        properties:
          instanceId: ${main.id}
          name: app_user
          password: app_password123
          roles:
            - role: read_write
              databaseName: app_database
            - role: read
              databaseName: logs_database
      adminUser:
        type: scaleway:mongodb:User
        name: admin_user
        properties:
          instanceId: ${main.id}
          name: admin_user
          password: admin_password123
          roles:
            - role: db_admin
              databaseName: admin
            - role: read
              anyDatabase: true
    

    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,
             instance_id: Optional[str] = None,
             name: Optional[str] = None,
             password: Optional[str] = None,
             password_wo: Optional[str] = None,
             password_wo_version: Optional[int] = None,
             region: Optional[str] = None,
             roles: Optional[Sequence[UserRoleArgs]] = None)
    func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs args, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: scaleway:mongodb: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 exampleuserResourceResourceFromMongodbuser = new Scaleway.Mongodb.User("exampleuserResourceResourceFromMongodbuser", new()
    {
        InstanceId = "string",
        Name = "string",
        Password = "string",
        PasswordWo = "string",
        PasswordWoVersion = 0,
        Region = "string",
        Roles = new[]
        {
            new Scaleway.Mongodb.Inputs.UserRoleArgs
            {
                Role = "string",
                AnyDatabase = false,
                DatabaseName = "string",
            },
        },
    });
    
    example, err := mongodb.NewUser(ctx, "exampleuserResourceResourceFromMongodbuser", &mongodb.UserArgs{
    	InstanceId:        pulumi.String("string"),
    	Name:              pulumi.String("string"),
    	Password:          pulumi.String("string"),
    	PasswordWo:        pulumi.String("string"),
    	PasswordWoVersion: pulumi.Int(0),
    	Region:            pulumi.String("string"),
    	Roles: mongodb.UserRoleArray{
    		&mongodb.UserRoleArgs{
    			Role:         pulumi.String("string"),
    			AnyDatabase:  pulumi.Bool(false),
    			DatabaseName: pulumi.String("string"),
    		},
    	},
    })
    
    var exampleuserResourceResourceFromMongodbuser = new com.pulumi.scaleway.mongodb.User("exampleuserResourceResourceFromMongodbuser", com.pulumi.scaleway.mongodb.UserArgs.builder()
        .instanceId("string")
        .name("string")
        .password("string")
        .passwordWo("string")
        .passwordWoVersion(0)
        .region("string")
        .roles(UserRoleArgs.builder()
            .role("string")
            .anyDatabase(false)
            .databaseName("string")
            .build())
        .build());
    
    exampleuser_resource_resource_from_mongodbuser = scaleway.mongodb.User("exampleuserResourceResourceFromMongodbuser",
        instance_id="string",
        name="string",
        password="string",
        password_wo="string",
        password_wo_version=0,
        region="string",
        roles=[{
            "role": "string",
            "any_database": False,
            "database_name": "string",
        }])
    
    const exampleuserResourceResourceFromMongodbuser = new scaleway.mongodb.User("exampleuserResourceResourceFromMongodbuser", {
        instanceId: "string",
        name: "string",
        password: "string",
        passwordWo: "string",
        passwordWoVersion: 0,
        region: "string",
        roles: [{
            role: "string",
            anyDatabase: false,
            databaseName: "string",
        }],
    });
    
    type: scaleway:mongodb:User
    properties:
        instanceId: string
        name: string
        password: string
        passwordWo: string
        passwordWoVersion: 0
        region: string
        roles:
            - anyDatabase: false
              databaseName: string
              role: 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:

    InstanceId string
    The ID of the MongoDB® instance.
    Name string
    The name of the MongoDB® user.
    Password string
    The password of the MongoDB® user.
    PasswordWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    PasswordWoVersion int
    Region string
    region) The region in which the MongoDB® user should be created.
    Roles List<Pulumiverse.Scaleway.Mongodb.Inputs.UserRole>
    List of roles assigned to the user. Each role block supports:
    InstanceId string
    The ID of the MongoDB® instance.
    Name string
    The name of the MongoDB® user.
    Password string
    The password of the MongoDB® user.
    PasswordWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    PasswordWoVersion int
    Region string
    region) The region in which the MongoDB® user should be created.
    Roles []UserRoleArgs
    List of roles assigned to the user. Each role block supports:
    instanceId String
    The ID of the MongoDB® instance.
    name String
    The name of the MongoDB® user.
    password String
    The password of the MongoDB® user.
    passwordWo String
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    passwordWoVersion Integer
    region String
    region) The region in which the MongoDB® user should be created.
    roles List<UserRole>
    List of roles assigned to the user. Each role block supports:
    instanceId string
    The ID of the MongoDB® instance.
    name string
    The name of the MongoDB® user.
    password string
    The password of the MongoDB® user.
    passwordWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    passwordWoVersion number
    region string
    region) The region in which the MongoDB® user should be created.
    roles UserRole[]
    List of roles assigned to the user. Each role block supports:
    instance_id str
    The ID of the MongoDB® instance.
    name str
    The name of the MongoDB® user.
    password str
    The password of the MongoDB® user.
    password_wo str
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    password_wo_version int
    region str
    region) The region in which the MongoDB® user should be created.
    roles Sequence[UserRoleArgs]
    List of roles assigned to the user. Each role block supports:
    instanceId String
    The ID of the MongoDB® instance.
    name String
    The name of the MongoDB® user.
    password String
    The password of the MongoDB® user.
    passwordWo String
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    passwordWoVersion Number
    region String
    region) The region in which the MongoDB® user should be created.
    roles List<Property Map>
    List of roles assigned to the user. Each role block supports:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing User Resource

    Get an existing User resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: UserState, opts?: CustomResourceOptions): User
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            instance_id: Optional[str] = None,
            name: Optional[str] = None,
            password: Optional[str] = None,
            password_wo: Optional[str] = None,
            password_wo_version: Optional[int] = None,
            region: Optional[str] = None,
            roles: Optional[Sequence[UserRoleArgs]] = None) -> User
    func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
    public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
    public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
    resources:  _:    type: scaleway:mongodb:User    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    InstanceId string
    The ID of the MongoDB® instance.
    Name string
    The name of the MongoDB® user.
    Password string
    The password of the MongoDB® user.
    PasswordWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    PasswordWoVersion int
    Region string
    region) The region in which the MongoDB® user should be created.
    Roles List<Pulumiverse.Scaleway.Mongodb.Inputs.UserRole>
    List of roles assigned to the user. Each role block supports:
    InstanceId string
    The ID of the MongoDB® instance.
    Name string
    The name of the MongoDB® user.
    Password string
    The password of the MongoDB® user.
    PasswordWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    PasswordWoVersion int
    Region string
    region) The region in which the MongoDB® user should be created.
    Roles []UserRoleArgs
    List of roles assigned to the user. Each role block supports:
    instanceId String
    The ID of the MongoDB® instance.
    name String
    The name of the MongoDB® user.
    password String
    The password of the MongoDB® user.
    passwordWo String
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    passwordWoVersion Integer
    region String
    region) The region in which the MongoDB® user should be created.
    roles List<UserRole>
    List of roles assigned to the user. Each role block supports:
    instanceId string
    The ID of the MongoDB® instance.
    name string
    The name of the MongoDB® user.
    password string
    The password of the MongoDB® user.
    passwordWo string
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    passwordWoVersion number
    region string
    region) The region in which the MongoDB® user should be created.
    roles UserRole[]
    List of roles assigned to the user. Each role block supports:
    instance_id str
    The ID of the MongoDB® instance.
    name str
    The name of the MongoDB® user.
    password str
    The password of the MongoDB® user.
    password_wo str
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    password_wo_version int
    region str
    region) The region in which the MongoDB® user should be created.
    roles Sequence[UserRoleArgs]
    List of roles assigned to the user. Each role block supports:
    instanceId String
    The ID of the MongoDB® instance.
    name String
    The name of the MongoDB® user.
    password String
    The password of the MongoDB® user.
    passwordWo String
    NOTE: This field is write-only and its value will not be updated in state as part of read operations.
    passwordWoVersion Number
    region String
    region) The region in which the MongoDB® user should be created.
    roles List<Property Map>
    List of roles assigned to the user. Each role block supports:

    Supporting Types

    UserRole, UserRoleArgs

    Role string
    The role name. Valid values are read, read_write, db_admin, sync.
    AnyDatabase bool
    Apply the role to all databases. Cannot be used with database_name.
    DatabaseName string
    The database name for the role. Cannot be used with any_database.
    Role string
    The role name. Valid values are read, read_write, db_admin, sync.
    AnyDatabase bool
    Apply the role to all databases. Cannot be used with database_name.
    DatabaseName string
    The database name for the role. Cannot be used with any_database.
    role String
    The role name. Valid values are read, read_write, db_admin, sync.
    anyDatabase Boolean
    Apply the role to all databases. Cannot be used with database_name.
    databaseName String
    The database name for the role. Cannot be used with any_database.
    role string
    The role name. Valid values are read, read_write, db_admin, sync.
    anyDatabase boolean
    Apply the role to all databases. Cannot be used with database_name.
    databaseName string
    The database name for the role. Cannot be used with any_database.
    role str
    The role name. Valid values are read, read_write, db_admin, sync.
    any_database bool
    Apply the role to all databases. Cannot be used with database_name.
    database_name str
    The database name for the role. Cannot be used with any_database.
    role String
    The role name. Valid values are read, read_write, db_admin, sync.
    anyDatabase Boolean
    Apply the role to all databases. Cannot be used with database_name.
    databaseName String
    The database name for the role. Cannot be used with any_database.

    Import

    MongoDB® users can be imported using the {region}/{instance_id}/{name}, e.g.

    bash

    $ pulumi import scaleway:mongodb/user:User main fr-par/11111111-1111-1111-1111-111111111111/my_user
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Viewing docs for Scaleway v1.44.1
    published on Monday, Mar 9, 2026 by pulumiverse
      Try Pulumi Cloud free. Your team will thank you.