1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. MongodbInstanceAccount
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.MongodbInstanceAccount

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    Provides a resource to create a mongodb instance_account

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const instanceAccount = new tencentcloud.MongodbInstanceAccount("instanceAccount", {
        authRoles: [{
            mask: 0,
            namespace: "*",
        }],
        instanceId: "cmgo-lxaz2c9b",
        mongoUserPassword: "xxxxxxxxx",
        password: "xxxxxxxx",
        userDesc: "test account",
        userName: "test_account",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    instance_account = tencentcloud.MongodbInstanceAccount("instanceAccount",
        auth_roles=[{
            "mask": 0,
            "namespace": "*",
        }],
        instance_id="cmgo-lxaz2c9b",
        mongo_user_password="xxxxxxxxx",
        password="xxxxxxxx",
        user_desc="test account",
        user_name="test_account")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewMongodbInstanceAccount(ctx, "instanceAccount", &tencentcloud.MongodbInstanceAccountArgs{
    			AuthRoles: tencentcloud.MongodbInstanceAccountAuthRoleArray{
    				&tencentcloud.MongodbInstanceAccountAuthRoleArgs{
    					Mask:      pulumi.Float64(0),
    					Namespace: pulumi.String("*"),
    				},
    			},
    			InstanceId:        pulumi.String("cmgo-lxaz2c9b"),
    			MongoUserPassword: pulumi.String("xxxxxxxxx"),
    			Password:          pulumi.String("xxxxxxxx"),
    			UserDesc:          pulumi.String("test account"),
    			UserName:          pulumi.String("test_account"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var instanceAccount = new Tencentcloud.MongodbInstanceAccount("instanceAccount", new()
        {
            AuthRoles = new[]
            {
                new Tencentcloud.Inputs.MongodbInstanceAccountAuthRoleArgs
                {
                    Mask = 0,
                    Namespace = "*",
                },
            },
            InstanceId = "cmgo-lxaz2c9b",
            MongoUserPassword = "xxxxxxxxx",
            Password = "xxxxxxxx",
            UserDesc = "test account",
            UserName = "test_account",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.MongodbInstanceAccount;
    import com.pulumi.tencentcloud.MongodbInstanceAccountArgs;
    import com.pulumi.tencentcloud.inputs.MongodbInstanceAccountAuthRoleArgs;
    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 instanceAccount = new MongodbInstanceAccount("instanceAccount", MongodbInstanceAccountArgs.builder()
                .authRoles(MongodbInstanceAccountAuthRoleArgs.builder()
                    .mask(0)
                    .namespace("*")
                    .build())
                .instanceId("cmgo-lxaz2c9b")
                .mongoUserPassword("xxxxxxxxx")
                .password("xxxxxxxx")
                .userDesc("test account")
                .userName("test_account")
                .build());
    
        }
    }
    
    resources:
      instanceAccount:
        type: tencentcloud:MongodbInstanceAccount
        properties:
          authRoles:
            - mask: 0
              namespace: '*'
          instanceId: cmgo-lxaz2c9b
          mongoUserPassword: xxxxxxxxx
          password: xxxxxxxx
          userDesc: test account
          userName: test_account
    

    Create MongodbInstanceAccount Resource

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

    Constructor syntax

    new MongodbInstanceAccount(name: string, args: MongodbInstanceAccountArgs, opts?: CustomResourceOptions);
    @overload
    def MongodbInstanceAccount(resource_name: str,
                               args: MongodbInstanceAccountArgs,
                               opts: Optional[ResourceOptions] = None)
    
    @overload
    def MongodbInstanceAccount(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               instance_id: Optional[str] = None,
                               user_name: Optional[str] = None,
                               auth_roles: Optional[Sequence[MongodbInstanceAccountAuthRoleArgs]] = None,
                               mongo_user_password: Optional[str] = None,
                               mongodb_instance_account_id: Optional[str] = None,
                               password: Optional[str] = None,
                               user_desc: Optional[str] = None)
    func NewMongodbInstanceAccount(ctx *Context, name string, args MongodbInstanceAccountArgs, opts ...ResourceOption) (*MongodbInstanceAccount, error)
    public MongodbInstanceAccount(string name, MongodbInstanceAccountArgs args, CustomResourceOptions? opts = null)
    public MongodbInstanceAccount(String name, MongodbInstanceAccountArgs args)
    public MongodbInstanceAccount(String name, MongodbInstanceAccountArgs args, CustomResourceOptions options)
    
    type: tencentcloud:MongodbInstanceAccount
    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 MongodbInstanceAccountArgs
    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 MongodbInstanceAccountArgs
    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 MongodbInstanceAccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MongodbInstanceAccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MongodbInstanceAccountArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    InstanceId string
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    UserName string
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    AuthRoles List<MongodbInstanceAccountAuthRole>
    The read and write permission information of the account.
    MongoUserPassword string
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    MongodbInstanceAccountId string
    ID of the resource.
    Password string
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    UserDesc string
    Account remarks.
    InstanceId string
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    UserName string
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    AuthRoles []MongodbInstanceAccountAuthRoleArgs
    The read and write permission information of the account.
    MongoUserPassword string
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    MongodbInstanceAccountId string
    ID of the resource.
    Password string
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    UserDesc string
    Account remarks.
    instanceId String
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    userName String
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    authRoles List<MongodbInstanceAccountAuthRole>
    The read and write permission information of the account.
    mongoUserPassword String
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    mongodbInstanceAccountId String
    ID of the resource.
    password String
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    userDesc String
    Account remarks.
    instanceId string
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    userName string
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    authRoles MongodbInstanceAccountAuthRole[]
    The read and write permission information of the account.
    mongoUserPassword string
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    mongodbInstanceAccountId string
    ID of the resource.
    password string
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    userDesc string
    Account remarks.
    instance_id str
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    user_name str
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    auth_roles Sequence[MongodbInstanceAccountAuthRoleArgs]
    The read and write permission information of the account.
    mongo_user_password str
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    mongodb_instance_account_id str
    ID of the resource.
    password str
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    user_desc str
    Account remarks.
    instanceId String
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    userName String
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    authRoles List<Property Map>
    The read and write permission information of the account.
    mongoUserPassword String
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    mongodbInstanceAccountId String
    ID of the resource.
    password String
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    userDesc String
    Account remarks.

    Outputs

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

    Get an existing MongodbInstanceAccount 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?: MongodbInstanceAccountState, opts?: CustomResourceOptions): MongodbInstanceAccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            auth_roles: Optional[Sequence[MongodbInstanceAccountAuthRoleArgs]] = None,
            instance_id: Optional[str] = None,
            mongo_user_password: Optional[str] = None,
            mongodb_instance_account_id: Optional[str] = None,
            password: Optional[str] = None,
            user_desc: Optional[str] = None,
            user_name: Optional[str] = None) -> MongodbInstanceAccount
    func GetMongodbInstanceAccount(ctx *Context, name string, id IDInput, state *MongodbInstanceAccountState, opts ...ResourceOption) (*MongodbInstanceAccount, error)
    public static MongodbInstanceAccount Get(string name, Input<string> id, MongodbInstanceAccountState? state, CustomResourceOptions? opts = null)
    public static MongodbInstanceAccount get(String name, Output<String> id, MongodbInstanceAccountState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:MongodbInstanceAccount    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:
    AuthRoles List<MongodbInstanceAccountAuthRole>
    The read and write permission information of the account.
    InstanceId string
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    MongoUserPassword string
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    MongodbInstanceAccountId string
    ID of the resource.
    Password string
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    UserDesc string
    Account remarks.
    UserName string
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    AuthRoles []MongodbInstanceAccountAuthRoleArgs
    The read and write permission information of the account.
    InstanceId string
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    MongoUserPassword string
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    MongodbInstanceAccountId string
    ID of the resource.
    Password string
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    UserDesc string
    Account remarks.
    UserName string
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    authRoles List<MongodbInstanceAccountAuthRole>
    The read and write permission information of the account.
    instanceId String
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    mongoUserPassword String
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    mongodbInstanceAccountId String
    ID of the resource.
    password String
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    userDesc String
    Account remarks.
    userName String
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    authRoles MongodbInstanceAccountAuthRole[]
    The read and write permission information of the account.
    instanceId string
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    mongoUserPassword string
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    mongodbInstanceAccountId string
    ID of the resource.
    password string
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    userDesc string
    Account remarks.
    userName string
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    auth_roles Sequence[MongodbInstanceAccountAuthRoleArgs]
    The read and write permission information of the account.
    instance_id str
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    mongo_user_password str
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    mongodb_instance_account_id str
    ID of the resource.
    password str
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    user_desc str
    Account remarks.
    user_name str
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.
    authRoles List<Property Map>
    The read and write permission information of the account.
    instanceId String
    Instance ID, the format is: cmgo-9d0p6umb.Same as the instance ID displayed in the cloud database console page.
    mongoUserPassword String
    The password corresponding to the mongouser account. mongouser is the system default account, which is the password set when creating an instance.
    mongodbInstanceAccountId String
    ID of the resource.
    password String
    New account password. Password complexity requirements are as follows: character length range [8,32]. Contains at least letters, numbers and special characters (exclamation point!, at@, pound sign #, percent sign %, caret ^, asterisk *, parentheses (), underscore _).
    userDesc String
    Account remarks.
    userName String
    The new account name. Its format requirements are as follows: character range [1,32]. Characters in the range of [A,Z], [a,z], [1,9] as well as underscore _ and dash - can be input.

    Supporting Types

    MongodbInstanceAccountAuthRole, MongodbInstanceAccountAuthRoleArgs

    Mask double
    Permission information of the current account. 0: No permission. 1: read-only. 2: Write only. 3: Read and write.
    Namespace string
    Refers to the name of the database with the current account permissions.*: Indicates all databases. db.name: Indicates the database of a specific name.
    Mask float64
    Permission information of the current account. 0: No permission. 1: read-only. 2: Write only. 3: Read and write.
    Namespace string
    Refers to the name of the database with the current account permissions.*: Indicates all databases. db.name: Indicates the database of a specific name.
    mask Double
    Permission information of the current account. 0: No permission. 1: read-only. 2: Write only. 3: Read and write.
    namespace String
    Refers to the name of the database with the current account permissions.*: Indicates all databases. db.name: Indicates the database of a specific name.
    mask number
    Permission information of the current account. 0: No permission. 1: read-only. 2: Write only. 3: Read and write.
    namespace string
    Refers to the name of the database with the current account permissions.*: Indicates all databases. db.name: Indicates the database of a specific name.
    mask float
    Permission information of the current account. 0: No permission. 1: read-only. 2: Write only. 3: Read and write.
    namespace str
    Refers to the name of the database with the current account permissions.*: Indicates all databases. db.name: Indicates the database of a specific name.
    mask Number
    Permission information of the current account. 0: No permission. 1: read-only. 2: Write only. 3: Read and write.
    namespace String
    Refers to the name of the database with the current account permissions.*: Indicates all databases. db.name: Indicates the database of a specific name.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack