AccountArgs

data class AccountArgs(val accountDescription: Output<String>? = null, val accountName: Output<String>? = null, val accountPassword: Output<String>? = null, val accountType: Output<String>? = null, val dbClusterId: Output<String>? = null, val kmsEncryptedPassword: Output<String>? = null, val kmsEncryptionContext: Output<Map<String, Any>>? = null) : ConvertibleToJava<AccountArgs>

Provides a PolarDB account resource and used to manage databases.

NOTE: Available in v1.67.0+.

Example Usage

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 defaultNodeClasses = PolardbFunctions.getNodeClasses(GetNodeClassesArgs.builder()
.dbType("MySQL")
.dbVersion("8.0")
.payType("PostPaid")
.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(defaultNodeClasses.applyValue(getNodeClassesResult -> getNodeClassesResult.classes()[0].zoneId()))
.vswitchName("terraform-example")
.build());
var defaultCluster = new Cluster("defaultCluster", ClusterArgs.builder()
.dbType("MySQL")
.dbVersion("8.0")
.dbNodeClass(defaultNodeClasses.applyValue(getNodeClassesResult -> getNodeClassesResult.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());
}
}

Import

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

$ pulumi import alicloud:polardb/account:Account example "pc-12345:tf_account"

Constructors

Link copied to clipboard
fun AccountArgs(accountDescription: Output<String>? = null, accountName: Output<String>? = null, accountPassword: Output<String>? = null, accountType: Output<String>? = null, dbClusterId: Output<String>? = null, kmsEncryptedPassword: Output<String>? = null, kmsEncryptionContext: Output<Map<String, Any>>? = null)

Functions

Link copied to clipboard
open override fun toJava(): AccountArgs

Properties

Link copied to clipboard
val accountDescription: Output<String>? = null

Account description. It cannot begin with https://. It must start with a Chinese character or English letter. It can include Chinese and English characters, underlines (_), hyphens (-), and numbers. The length may be 2-256 characters.

Link copied to clipboard
val accountName: Output<String>? = null

Operation account requiring a uniqueness check. It may consist of lower case letters, numbers, and underlines, and must start with a letter and have no more than 16 characters.

Link copied to clipboard
val accountPassword: Output<String>? = null

Operation password. It may consist of letters, digits, or underlines, with a length of 6 to 32 characters.

Link copied to clipboard
val accountType: Output<String>? = null

Account type, Valid values are Normal, Super, Default to Normal.

Link copied to clipboard
val dbClusterId: Output<String>? = null

The Id of cluster in which account belongs.

Link copied to clipboard
val kmsEncryptedPassword: Output<String>? = null

An KMS encrypts password used to a db account. If the account_password is filled in, this field will be ignored.

Link copied to clipboard
val kmsEncryptionContext: Output<Map<String, Any>>? = null

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.