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

tencentcloud.DcdbAccount

Explore with Pulumi AI

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

    Provides a resource to create a dcdb account

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const account = new tencentcloud.DcdbAccount("account", {
        description: "this is a test account",
        host: "127.0.0.1",
        instanceId: "tdsqlshard-kkpoxvnv",
        maxUserConnections: 10,
        password: "===password===",
        readOnly: 0,
        userName: "mysql",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    account = tencentcloud.DcdbAccount("account",
        description="this is a test account",
        host="127.0.0.1",
        instance_id="tdsqlshard-kkpoxvnv",
        max_user_connections=10,
        password="===password===",
        read_only=0,
        user_name="mysql")
    
    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.NewDcdbAccount(ctx, "account", &tencentcloud.DcdbAccountArgs{
    			Description:        pulumi.String("this is a test account"),
    			Host:               pulumi.String("127.0.0.1"),
    			InstanceId:         pulumi.String("tdsqlshard-kkpoxvnv"),
    			MaxUserConnections: pulumi.Float64(10),
    			Password:           pulumi.String("===password==="),
    			ReadOnly:           pulumi.Float64(0),
    			UserName:           pulumi.String("mysql"),
    		})
    		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 account = new Tencentcloud.DcdbAccount("account", new()
        {
            Description = "this is a test account",
            Host = "127.0.0.1",
            InstanceId = "tdsqlshard-kkpoxvnv",
            MaxUserConnections = 10,
            Password = "===password===",
            ReadOnly = 0,
            UserName = "mysql",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.DcdbAccount;
    import com.pulumi.tencentcloud.DcdbAccountArgs;
    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 account = new DcdbAccount("account", DcdbAccountArgs.builder()
                .description("this is a test account")
                .host("127.0.0.1")
                .instanceId("tdsqlshard-kkpoxvnv")
                .maxUserConnections(10)
                .password("===password===")
                .readOnly(0)
                .userName("mysql")
                .build());
    
        }
    }
    
    resources:
      account:
        type: tencentcloud:DcdbAccount
        properties:
          description: this is a test account
          host: 127.0.0.1
          instanceId: tdsqlshard-kkpoxvnv
          maxUserConnections: 10
          password: ===password===
          readOnly: 0
          userName: mysql
    

    Create DcdbAccount Resource

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

    Constructor syntax

    new DcdbAccount(name: string, args: DcdbAccountArgs, opts?: CustomResourceOptions);
    @overload
    def DcdbAccount(resource_name: str,
                    args: DcdbAccountArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def DcdbAccount(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    host: Optional[str] = None,
                    instance_id: Optional[str] = None,
                    password: Optional[str] = None,
                    user_name: Optional[str] = None,
                    dcdb_account_id: Optional[str] = None,
                    description: Optional[str] = None,
                    max_user_connections: Optional[float] = None,
                    read_only: Optional[float] = None)
    func NewDcdbAccount(ctx *Context, name string, args DcdbAccountArgs, opts ...ResourceOption) (*DcdbAccount, error)
    public DcdbAccount(string name, DcdbAccountArgs args, CustomResourceOptions? opts = null)
    public DcdbAccount(String name, DcdbAccountArgs args)
    public DcdbAccount(String name, DcdbAccountArgs args, CustomResourceOptions options)
    
    type: tencentcloud:DcdbAccount
    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 DcdbAccountArgs
    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 DcdbAccountArgs
    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 DcdbAccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DcdbAccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DcdbAccountArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    Host string
    db host.
    InstanceId string
    instance id.
    Password string
    password.
    UserName string
    account name.
    DcdbAccountId string
    ID of the resource.
    Description string
    description for account.
    MaxUserConnections double
    max user connections.
    ReadOnly double
    whether the account is readonly. 0 means not a readonly account.
    Host string
    db host.
    InstanceId string
    instance id.
    Password string
    password.
    UserName string
    account name.
    DcdbAccountId string
    ID of the resource.
    Description string
    description for account.
    MaxUserConnections float64
    max user connections.
    ReadOnly float64
    whether the account is readonly. 0 means not a readonly account.
    host String
    db host.
    instanceId String
    instance id.
    password String
    password.
    userName String
    account name.
    dcdbAccountId String
    ID of the resource.
    description String
    description for account.
    maxUserConnections Double
    max user connections.
    readOnly Double
    whether the account is readonly. 0 means not a readonly account.
    host string
    db host.
    instanceId string
    instance id.
    password string
    password.
    userName string
    account name.
    dcdbAccountId string
    ID of the resource.
    description string
    description for account.
    maxUserConnections number
    max user connections.
    readOnly number
    whether the account is readonly. 0 means not a readonly account.
    host str
    db host.
    instance_id str
    instance id.
    password str
    password.
    user_name str
    account name.
    dcdb_account_id str
    ID of the resource.
    description str
    description for account.
    max_user_connections float
    max user connections.
    read_only float
    whether the account is readonly. 0 means not a readonly account.
    host String
    db host.
    instanceId String
    instance id.
    password String
    password.
    userName String
    account name.
    dcdbAccountId String
    ID of the resource.
    description String
    description for account.
    maxUserConnections Number
    max user connections.
    readOnly Number
    whether the account is readonly. 0 means not a readonly account.

    Outputs

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

    Get an existing DcdbAccount 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?: DcdbAccountState, opts?: CustomResourceOptions): DcdbAccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dcdb_account_id: Optional[str] = None,
            description: Optional[str] = None,
            host: Optional[str] = None,
            instance_id: Optional[str] = None,
            max_user_connections: Optional[float] = None,
            password: Optional[str] = None,
            read_only: Optional[float] = None,
            user_name: Optional[str] = None) -> DcdbAccount
    func GetDcdbAccount(ctx *Context, name string, id IDInput, state *DcdbAccountState, opts ...ResourceOption) (*DcdbAccount, error)
    public static DcdbAccount Get(string name, Input<string> id, DcdbAccountState? state, CustomResourceOptions? opts = null)
    public static DcdbAccount get(String name, Output<String> id, DcdbAccountState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:DcdbAccount    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:
    DcdbAccountId string
    ID of the resource.
    Description string
    description for account.
    Host string
    db host.
    InstanceId string
    instance id.
    MaxUserConnections double
    max user connections.
    Password string
    password.
    ReadOnly double
    whether the account is readonly. 0 means not a readonly account.
    UserName string
    account name.
    DcdbAccountId string
    ID of the resource.
    Description string
    description for account.
    Host string
    db host.
    InstanceId string
    instance id.
    MaxUserConnections float64
    max user connections.
    Password string
    password.
    ReadOnly float64
    whether the account is readonly. 0 means not a readonly account.
    UserName string
    account name.
    dcdbAccountId String
    ID of the resource.
    description String
    description for account.
    host String
    db host.
    instanceId String
    instance id.
    maxUserConnections Double
    max user connections.
    password String
    password.
    readOnly Double
    whether the account is readonly. 0 means not a readonly account.
    userName String
    account name.
    dcdbAccountId string
    ID of the resource.
    description string
    description for account.
    host string
    db host.
    instanceId string
    instance id.
    maxUserConnections number
    max user connections.
    password string
    password.
    readOnly number
    whether the account is readonly. 0 means not a readonly account.
    userName string
    account name.
    dcdb_account_id str
    ID of the resource.
    description str
    description for account.
    host str
    db host.
    instance_id str
    instance id.
    max_user_connections float
    max user connections.
    password str
    password.
    read_only float
    whether the account is readonly. 0 means not a readonly account.
    user_name str
    account name.
    dcdbAccountId String
    ID of the resource.
    description String
    description for account.
    host String
    db host.
    instanceId String
    instance id.
    maxUserConnections Number
    max user connections.
    password String
    password.
    readOnly Number
    whether the account is readonly. 0 means not a readonly account.
    userName String
    account name.

    Import

    dcdb account can be imported using the id, e.g.

    $ pulumi import tencentcloud:index/dcdbAccount:DcdbAccount account account_id
    

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

    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