1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. polardb
  5. Account
Alibaba Cloud v3.93.0 published on Tuesday, Jan 27, 2026 by Pulumi
alicloud logo
Alibaba Cloud v3.93.0 published on Tuesday, Jan 27, 2026 by Pulumi

    Provides a Polar Db Account resource.

    Database account information.

    For information about Polar Db Account and how to use it, see What is Account.

    NOTE: Available since v1.67.0.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const _default = alicloud.polardb.getNodeClasses({
        dbType: "MySQL",
        dbVersion: "8.0",
        payType: "PostPaid",
        category: "Normal",
    });
    const defaultNetwork = new alicloud.vpc.Network("default", {
        vpcName: "terraform-example",
        cidrBlock: "172.16.0.0/16",
    });
    const defaultSwitch = new alicloud.vpc.Switch("default", {
        vpcId: defaultNetwork.id,
        cidrBlock: "172.16.0.0/24",
        zoneId: _default.then(_default => _default.classes?.[0]?.zoneId),
        vswitchName: "terraform-example",
    });
    const defaultCluster = new alicloud.polardb.Cluster("default", {
        dbType: "MySQL",
        dbVersion: "8.0",
        dbNodeClass: _default.then(_default => _default.classes?.[0]?.supportedEngines?.[0]?.availableResources?.[0]?.dbNodeClass),
        payType: "PostPaid",
        vswitchId: defaultSwitch.id,
        description: "terraform-example",
    });
    const defaultAccount = new alicloud.polardb.Account("default", {
        dbClusterId: defaultCluster.id,
        accountName: "terraform_example",
        accountPassword: "Example1234",
        accountDescription: "terraform-example",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.polardb.get_node_classes(db_type="MySQL",
        db_version="8.0",
        pay_type="PostPaid",
        category="Normal")
    default_network = alicloud.vpc.Network("default",
        vpc_name="terraform-example",
        cidr_block="172.16.0.0/16")
    default_switch = alicloud.vpc.Switch("default",
        vpc_id=default_network.id,
        cidr_block="172.16.0.0/24",
        zone_id=default.classes[0].zone_id,
        vswitch_name="terraform-example")
    default_cluster = alicloud.polardb.Cluster("default",
        db_type="MySQL",
        db_version="8.0",
        db_node_class=default.classes[0].supported_engines[0].available_resources[0].db_node_class,
        pay_type="PostPaid",
        vswitch_id=default_switch.id,
        description="terraform-example")
    default_account = alicloud.polardb.Account("default",
        db_cluster_id=default_cluster.id,
        account_name="terraform_example",
        account_password="Example1234",
        account_description="terraform-example")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/polardb"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := polardb.GetNodeClasses(ctx, &polardb.GetNodeClassesArgs{
    			DbType:    pulumi.StringRef("MySQL"),
    			DbVersion: pulumi.StringRef("8.0"),
    			PayType:   "PostPaid",
    			Category:  pulumi.StringRef("Normal"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		defaultNetwork, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
    			VpcName:   pulumi.String("terraform-example"),
    			CidrBlock: pulumi.String("172.16.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultSwitch, err := vpc.NewSwitch(ctx, "default", &vpc.SwitchArgs{
    			VpcId:       defaultNetwork.ID(),
    			CidrBlock:   pulumi.String("172.16.0.0/24"),
    			ZoneId:      pulumi.String(_default.Classes[0].ZoneId),
    			VswitchName: pulumi.String("terraform-example"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultCluster, err := polardb.NewCluster(ctx, "default", &polardb.ClusterArgs{
    			DbType:      pulumi.String("MySQL"),
    			DbVersion:   pulumi.String("8.0"),
    			DbNodeClass: pulumi.String(_default.Classes[0].SupportedEngines[0].AvailableResources[0].DbNodeClass),
    			PayType:     pulumi.String("PostPaid"),
    			VswitchId:   defaultSwitch.ID(),
    			Description: pulumi.String("terraform-example"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = polardb.NewAccount(ctx, "default", &polardb.AccountArgs{
    			DbClusterId:        defaultCluster.ID(),
    			AccountName:        pulumi.String("terraform_example"),
    			AccountPassword:    pulumi.String("Example1234"),
    			AccountDescription: pulumi.String("terraform-example"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.PolarDB.GetNodeClasses.Invoke(new()
        {
            DbType = "MySQL",
            DbVersion = "8.0",
            PayType = "PostPaid",
            Category = "Normal",
        });
    
        var defaultNetwork = new AliCloud.Vpc.Network("default", new()
        {
            VpcName = "terraform-example",
            CidrBlock = "172.16.0.0/16",
        });
    
        var defaultSwitch = new AliCloud.Vpc.Switch("default", new()
        {
            VpcId = defaultNetwork.Id,
            CidrBlock = "172.16.0.0/24",
            ZoneId = @default.Apply(@default => @default.Apply(getNodeClassesResult => getNodeClassesResult.Classes[0]?.ZoneId)),
            VswitchName = "terraform-example",
        });
    
        var defaultCluster = new AliCloud.PolarDB.Cluster("default", new()
        {
            DbType = "MySQL",
            DbVersion = "8.0",
            DbNodeClass = @default.Apply(@default => @default.Apply(getNodeClassesResult => getNodeClassesResult.Classes[0]?.SupportedEngines[0]?.AvailableResources[0]?.DbNodeClass)),
            PayType = "PostPaid",
            VswitchId = defaultSwitch.Id,
            Description = "terraform-example",
        });
    
        var defaultAccount = new AliCloud.PolarDB.Account("default", new()
        {
            DbClusterId = defaultCluster.Id,
            AccountName = "terraform_example",
            AccountPassword = "Example1234",
            AccountDescription = "terraform-example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.polardb.PolardbFunctions;
    import com.pulumi.alicloud.polardb.inputs.GetNodeClassesArgs;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.Switch;
    import com.pulumi.alicloud.vpc.SwitchArgs;
    import com.pulumi.alicloud.polardb.Cluster;
    import com.pulumi.alicloud.polardb.ClusterArgs;
    import com.pulumi.alicloud.polardb.Account;
    import com.pulumi.alicloud.polardb.AccountArgs;
    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) {
            final var default = PolardbFunctions.getNodeClasses(GetNodeClassesArgs.builder()
                .dbType("MySQL")
                .dbVersion("8.0")
                .payType("PostPaid")
                .category("Normal")
                .build());
    
            var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
                .vpcName("terraform-example")
                .cidrBlock("172.16.0.0/16")
                .build());
    
            var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
                .vpcId(defaultNetwork.id())
                .cidrBlock("172.16.0.0/24")
                .zoneId(default_.classes()[0].zoneId())
                .vswitchName("terraform-example")
                .build());
    
            var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
                .dbType("MySQL")
                .dbVersion("8.0")
                .dbNodeClass(default_.classes()[0].supportedEngines()[0].availableResources()[0].dbNodeClass())
                .payType("PostPaid")
                .vswitchId(defaultSwitch.id())
                .description("terraform-example")
                .build());
    
            var defaultAccount = new Account("defaultAccount", AccountArgs.builder()
                .dbClusterId(defaultCluster.id())
                .accountName("terraform_example")
                .accountPassword("Example1234")
                .accountDescription("terraform-example")
                .build());
    
        }
    }
    
    resources:
      defaultNetwork:
        type: alicloud:vpc:Network
        name: default
        properties:
          vpcName: terraform-example
          cidrBlock: 172.16.0.0/16
      defaultSwitch:
        type: alicloud:vpc:Switch
        name: default
        properties:
          vpcId: ${defaultNetwork.id}
          cidrBlock: 172.16.0.0/24
          zoneId: ${default.classes[0].zoneId}
          vswitchName: terraform-example
      defaultCluster:
        type: alicloud:polardb:Cluster
        name: default
        properties:
          dbType: MySQL
          dbVersion: '8.0'
          dbNodeClass: ${default.classes[0].supportedEngines[0].availableResources[0].dbNodeClass}
          payType: PostPaid
          vswitchId: ${defaultSwitch.id}
          description: terraform-example
      defaultAccount:
        type: alicloud:polardb:Account
        name: default
        properties:
          dbClusterId: ${defaultCluster.id}
          accountName: terraform_example
          accountPassword: Example1234
          accountDescription: terraform-example
    variables:
      default:
        fn::invoke:
          function: alicloud:polardb:getNodeClasses
          arguments:
            dbType: MySQL
            dbVersion: '8.0'
            payType: PostPaid
            category: Normal
    

    📚 Need more examples? VIEW MORE EXAMPLES

    Create Account Resource

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

    Constructor syntax

    new Account(name: string, args: AccountArgs, opts?: CustomResourceOptions);
    @overload
    def Account(resource_name: str,
                args: AccountArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Account(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                account_name: Optional[str] = None,
                db_cluster_id: Optional[str] = None,
                account_description: Optional[str] = None,
                account_lock_state: Optional[str] = None,
                account_password: Optional[str] = None,
                account_password_valid_time: Optional[str] = None,
                account_type: Optional[str] = None,
                kms_encrypted_password: Optional[str] = None,
                kms_encryption_context: Optional[Mapping[str, str]] = None)
    func NewAccount(ctx *Context, name string, args AccountArgs, opts ...ResourceOption) (*Account, error)
    public Account(string name, AccountArgs args, CustomResourceOptions? opts = null)
    public Account(String name, AccountArgs args)
    public Account(String name, AccountArgs args, CustomResourceOptions options)
    
    type: alicloud:polardb:Account
    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 AccountArgs
    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 AccountArgs
    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 AccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AccountArgs
    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 exampleaccountResourceResourceFromPolardbaccount = new AliCloud.PolarDB.Account("exampleaccountResourceResourceFromPolardbaccount", new()
    {
        AccountName = "string",
        DbClusterId = "string",
        AccountDescription = "string",
        AccountLockState = "string",
        AccountPassword = "string",
        AccountPasswordValidTime = "string",
        AccountType = "string",
        KmsEncryptedPassword = "string",
        KmsEncryptionContext = 
        {
            { "string", "string" },
        },
    });
    
    example, err := polardb.NewAccount(ctx, "exampleaccountResourceResourceFromPolardbaccount", &polardb.AccountArgs{
    	AccountName:              pulumi.String("string"),
    	DbClusterId:              pulumi.String("string"),
    	AccountDescription:       pulumi.String("string"),
    	AccountLockState:         pulumi.String("string"),
    	AccountPassword:          pulumi.String("string"),
    	AccountPasswordValidTime: pulumi.String("string"),
    	AccountType:              pulumi.String("string"),
    	KmsEncryptedPassword:     pulumi.String("string"),
    	KmsEncryptionContext: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var exampleaccountResourceResourceFromPolardbaccount = new com.pulumi.alicloud.polardb.Account("exampleaccountResourceResourceFromPolardbaccount", com.pulumi.alicloud.polardb.AccountArgs.builder()
        .accountName("string")
        .dbClusterId("string")
        .accountDescription("string")
        .accountLockState("string")
        .accountPassword("string")
        .accountPasswordValidTime("string")
        .accountType("string")
        .kmsEncryptedPassword("string")
        .kmsEncryptionContext(Map.of("string", "string"))
        .build());
    
    exampleaccount_resource_resource_from_polardbaccount = alicloud.polardb.Account("exampleaccountResourceResourceFromPolardbaccount",
        account_name="string",
        db_cluster_id="string",
        account_description="string",
        account_lock_state="string",
        account_password="string",
        account_password_valid_time="string",
        account_type="string",
        kms_encrypted_password="string",
        kms_encryption_context={
            "string": "string",
        })
    
    const exampleaccountResourceResourceFromPolardbaccount = new alicloud.polardb.Account("exampleaccountResourceResourceFromPolardbaccount", {
        accountName: "string",
        dbClusterId: "string",
        accountDescription: "string",
        accountLockState: "string",
        accountPassword: "string",
        accountPasswordValidTime: "string",
        accountType: "string",
        kmsEncryptedPassword: "string",
        kmsEncryptionContext: {
            string: "string",
        },
    });
    
    type: alicloud:polardb:Account
    properties:
        accountDescription: string
        accountLockState: string
        accountName: string
        accountPassword: string
        accountPasswordValidTime: string
        accountType: string
        dbClusterId: string
        kmsEncryptedPassword: string
        kmsEncryptionContext:
            string: string
    

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

    AccountName string
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    DbClusterId string
    The cluster ID.
    AccountDescription string
    The description of the database account.
    AccountLockState string
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    AccountPassword string
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    AccountPasswordValidTime string
    The time when the password for the database account expires.
    AccountType string
    The account type. Default value:Normal. Valid values: Normal, Super.
    KmsEncryptedPassword string
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    KmsEncryptionContext Dictionary<string, string>
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    AccountName string
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    DbClusterId string
    The cluster ID.
    AccountDescription string
    The description of the database account.
    AccountLockState string
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    AccountPassword string
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    AccountPasswordValidTime string
    The time when the password for the database account expires.
    AccountType string
    The account type. Default value:Normal. Valid values: Normal, Super.
    KmsEncryptedPassword string
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    KmsEncryptionContext map[string]string
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    accountName String
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    dbClusterId String
    The cluster ID.
    accountDescription String
    The description of the database account.
    accountLockState String
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    accountPassword String
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    accountPasswordValidTime String
    The time when the password for the database account expires.
    accountType String
    The account type. Default value:Normal. Valid values: Normal, Super.
    kmsEncryptedPassword String
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    kmsEncryptionContext Map<String,String>
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    accountName string
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    dbClusterId string
    The cluster ID.
    accountDescription string
    The description of the database account.
    accountLockState string
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    accountPassword string
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    accountPasswordValidTime string
    The time when the password for the database account expires.
    accountType string
    The account type. Default value:Normal. Valid values: Normal, Super.
    kmsEncryptedPassword string
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    kmsEncryptionContext {[key: string]: string}
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    account_name str
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    db_cluster_id str
    The cluster ID.
    account_description str
    The description of the database account.
    account_lock_state str
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    account_password str
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    account_password_valid_time str
    The time when the password for the database account expires.
    account_type str
    The account type. Default value:Normal. Valid values: Normal, Super.
    kms_encrypted_password str
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    kms_encryption_context Mapping[str, str]
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    accountName String
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    dbClusterId String
    The cluster ID.
    accountDescription String
    The description of the database account.
    accountLockState String
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    accountPassword String
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    accountPasswordValidTime String
    The time when the password for the database account expires.
    accountType String
    The account type. Default value:Normal. Valid values: Normal, Super.
    kmsEncryptedPassword String
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    kmsEncryptionContext Map<String>
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    (Available since v1.265.0) The status of the database account.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    (Available since v1.265.0) The status of the database account.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    (Available since v1.265.0) The status of the database account.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    (Available since v1.265.0) The status of the database account.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    (Available since v1.265.0) The status of the database account.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    (Available since v1.265.0) The status of the database account.

    Look up Existing Account Resource

    Get an existing Account 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?: AccountState, opts?: CustomResourceOptions): Account
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_description: Optional[str] = None,
            account_lock_state: Optional[str] = None,
            account_name: Optional[str] = None,
            account_password: Optional[str] = None,
            account_password_valid_time: Optional[str] = None,
            account_type: Optional[str] = None,
            db_cluster_id: Optional[str] = None,
            kms_encrypted_password: Optional[str] = None,
            kms_encryption_context: Optional[Mapping[str, str]] = None,
            status: Optional[str] = None) -> Account
    func GetAccount(ctx *Context, name string, id IDInput, state *AccountState, opts ...ResourceOption) (*Account, error)
    public static Account Get(string name, Input<string> id, AccountState? state, CustomResourceOptions? opts = null)
    public static Account get(String name, Output<String> id, AccountState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:polardb:Account    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:
    AccountDescription string
    The description of the database account.
    AccountLockState string
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    AccountName string
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    AccountPassword string
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    AccountPasswordValidTime string
    The time when the password for the database account expires.
    AccountType string
    The account type. Default value:Normal. Valid values: Normal, Super.
    DbClusterId string
    The cluster ID.
    KmsEncryptedPassword string
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    KmsEncryptionContext Dictionary<string, string>
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    Status string
    (Available since v1.265.0) The status of the database account.
    AccountDescription string
    The description of the database account.
    AccountLockState string
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    AccountName string
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    AccountPassword string
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    AccountPasswordValidTime string
    The time when the password for the database account expires.
    AccountType string
    The account type. Default value:Normal. Valid values: Normal, Super.
    DbClusterId string
    The cluster ID.
    KmsEncryptedPassword string
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    KmsEncryptionContext map[string]string
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    Status string
    (Available since v1.265.0) The status of the database account.
    accountDescription String
    The description of the database account.
    accountLockState String
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    accountName String
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    accountPassword String
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    accountPasswordValidTime String
    The time when the password for the database account expires.
    accountType String
    The account type. Default value:Normal. Valid values: Normal, Super.
    dbClusterId String
    The cluster ID.
    kmsEncryptedPassword String
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    kmsEncryptionContext Map<String,String>
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    status String
    (Available since v1.265.0) The status of the database account.
    accountDescription string
    The description of the database account.
    accountLockState string
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    accountName string
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    accountPassword string
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    accountPasswordValidTime string
    The time when the password for the database account expires.
    accountType string
    The account type. Default value:Normal. Valid values: Normal, Super.
    dbClusterId string
    The cluster ID.
    kmsEncryptedPassword string
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    kmsEncryptionContext {[key: string]: string}
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    status string
    (Available since v1.265.0) The status of the database account.
    account_description str
    The description of the database account.
    account_lock_state str
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    account_name str
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    account_password str
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    account_password_valid_time str
    The time when the password for the database account expires.
    account_type str
    The account type. Default value:Normal. Valid values: Normal, Super.
    db_cluster_id str
    The cluster ID.
    kms_encrypted_password str
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    kms_encryption_context Mapping[str, str]
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    status str
    (Available since v1.265.0) The status of the database account.
    accountDescription String
    The description of the database account.
    accountLockState String
    The lock status of the account. Valid values:

    • UnLock: The account is not locked.
    • Lock: The account is locked.
    accountName String
    The account name. Must meet the following requirements:

    • Start with a lowercase letter and end with a letter or number.
    • Consists of lowercase letters, numbers, or underscores.
    • The length is 2 to 16 characters.
    • You cannot use some reserved usernames, such as root and admin.
    accountPassword String
    The account password. You have to specify one of account_password and kms_encrypted_password fields. Must meet the following requirements:

    • Contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
    • Be 8 to 32 characters in length.
    • Special characters include !@#$%^&*()_+-=.
    accountPasswordValidTime String
    The time when the password for the database account expires.
    accountType String
    The account type. Default value:Normal. Valid values: Normal, Super.
    dbClusterId String
    The cluster ID.
    kmsEncryptedPassword String
    An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.
    kmsEncryptionContext Map<String>
    An KMS encryption context used to decrypt kms_encrypted_password before creating or updating a db account with kms_encrypted_password. See Encryption Context. It is valid when kms_encrypted_password is set.
    status String
    (Available since v1.265.0) The status of the database account.

    Import

    Polar Db Account can be imported using the id, e.g.

    $ pulumi import alicloud:polardb/account:Account example <db_cluster_id>:<account_name>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.93.0 published on Tuesday, Jan 27, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate