1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. MongoUser
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.MongoUser

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    Create MongoUser Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new MongoUser(name: string, args: MongoUserArgs, opts?: CustomResourceOptions);
    @overload
    def MongoUser(resource_name: str,
                  args: MongoUserArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def MongoUser(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  cluster_id: Optional[str] = None,
                  password: Optional[str] = None,
                  username: Optional[str] = None,
                  mongo_user_id: Optional[str] = None,
                  roles: Optional[Sequence[MongoUserRoleArgs]] = None,
                  timeouts: Optional[MongoUserTimeoutsArgs] = None)
    func NewMongoUser(ctx *Context, name string, args MongoUserArgs, opts ...ResourceOption) (*MongoUser, error)
    public MongoUser(string name, MongoUserArgs args, CustomResourceOptions? opts = null)
    public MongoUser(String name, MongoUserArgs args)
    public MongoUser(String name, MongoUserArgs args, CustomResourceOptions options)
    
    type: ionoscloud:MongoUser
    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 MongoUserArgs
    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 MongoUserArgs
    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 MongoUserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MongoUserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MongoUserArgs
    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 mongoUserResource = new Ionoscloud.MongoUser("mongoUserResource", new()
    {
        ClusterId = "string",
        Password = "string",
        Username = "string",
        MongoUserId = "string",
        Roles = new[]
        {
            new Ionoscloud.Inputs.MongoUserRoleArgs
            {
                Database = "string",
                Role = "string",
            },
        },
        Timeouts = new Ionoscloud.Inputs.MongoUserTimeoutsArgs
        {
            Create = "string",
            Default = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := ionoscloud.NewMongoUser(ctx, "mongoUserResource", &ionoscloud.MongoUserArgs{
    	ClusterId:   pulumi.String("string"),
    	Password:    pulumi.String("string"),
    	Username:    pulumi.String("string"),
    	MongoUserId: pulumi.String("string"),
    	Roles: ionoscloud.MongoUserRoleArray{
    		&ionoscloud.MongoUserRoleArgs{
    			Database: pulumi.String("string"),
    			Role:     pulumi.String("string"),
    		},
    	},
    	Timeouts: &ionoscloud.MongoUserTimeoutsArgs{
    		Create:  pulumi.String("string"),
    		Default: pulumi.String("string"),
    		Delete:  pulumi.String("string"),
    		Update:  pulumi.String("string"),
    	},
    })
    
    var mongoUserResource = new MongoUser("mongoUserResource", MongoUserArgs.builder()
        .clusterId("string")
        .password("string")
        .username("string")
        .mongoUserId("string")
        .roles(MongoUserRoleArgs.builder()
            .database("string")
            .role("string")
            .build())
        .timeouts(MongoUserTimeoutsArgs.builder()
            .create("string")
            .default_("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    mongo_user_resource = ionoscloud.MongoUser("mongoUserResource",
        cluster_id="string",
        password="string",
        username="string",
        mongo_user_id="string",
        roles=[{
            "database": "string",
            "role": "string",
        }],
        timeouts={
            "create": "string",
            "default": "string",
            "delete": "string",
            "update": "string",
        })
    
    const mongoUserResource = new ionoscloud.MongoUser("mongoUserResource", {
        clusterId: "string",
        password: "string",
        username: "string",
        mongoUserId: "string",
        roles: [{
            database: "string",
            role: "string",
        }],
        timeouts: {
            create: "string",
            "default": "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: ionoscloud:MongoUser
    properties:
        clusterId: string
        mongoUserId: string
        password: string
        roles:
            - database: string
              role: string
        timeouts:
            create: string
            default: string
            delete: string
            update: string
        username: string
    

    MongoUser 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 MongoUser resource accepts the following input properties:

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MongoUser 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 MongoUser Resource

    Get an existing MongoUser 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?: MongoUserState, opts?: CustomResourceOptions): MongoUser
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            mongo_user_id: Optional[str] = None,
            password: Optional[str] = None,
            roles: Optional[Sequence[MongoUserRoleArgs]] = None,
            timeouts: Optional[MongoUserTimeoutsArgs] = None,
            username: Optional[str] = None) -> MongoUser
    func GetMongoUser(ctx *Context, name string, id IDInput, state *MongoUserState, opts ...ResourceOption) (*MongoUser, error)
    public static MongoUser Get(string name, Input<string> id, MongoUserState? state, CustomResourceOptions? opts = null)
    public static MongoUser get(String name, Output<String> id, MongoUserState state, CustomResourceOptions options)
    resources:  _:    type: ionoscloud:MongoUser    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.

    Supporting Types

    MongoUserRole, MongoUserRoleArgs

    Database string
    Role string
    A list of mongodb user roles. Examples: read, readWrite, readAnyDatabase
    Database string
    Role string
    A list of mongodb user roles. Examples: read, readWrite, readAnyDatabase
    database String
    role String
    A list of mongodb user roles. Examples: read, readWrite, readAnyDatabase
    database string
    role string
    A list of mongodb user roles. Examples: read, readWrite, readAnyDatabase
    database str
    role str
    A list of mongodb user roles. Examples: read, readWrite, readAnyDatabase
    database String
    role String
    A list of mongodb user roles. Examples: read, readWrite, readAnyDatabase

    MongoUserTimeouts, MongoUserTimeoutsArgs

    Create string
    Default string
    Delete string
    Update string
    Create string
    Default string
    Delete string
    Update string
    create String
    default_ String
    delete String
    update String
    create string
    default string
    delete string
    update string
    create String
    default String
    delete String
    update String

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud