RdsAccount

class RdsAccount : KotlinCustomResource

Provides a RDS Account resource. For information about RDS Account and how to use it, see What is Account.

NOTE: Available since v1.120.0.

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.rds.RdsFunctions;
import com.pulumi.alicloud.rds.inputs.GetZonesArgs;
import com.pulumi.alicloud.rds.inputs.GetInstanceClassesArgs;
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.rds.Instance;
import com.pulumi.alicloud.rds.InstanceArgs;
import com.pulumi.alicloud.rds.RdsAccount;
import com.pulumi.alicloud.rds.RdsAccountArgs;
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 config = ctx.config();
final var name = config.get("name").orElse("tf_example");
final var defaultZones = RdsFunctions.getZones(GetZonesArgs.builder()
.engine("MySQL")
.engineVersion("5.6")
.build());
final var defaultInstanceClasses = RdsFunctions.getInstanceClasses(GetInstanceClassesArgs.builder()
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
.engine("MySQL")
.engineVersion("5.6")
.build());
var defaultNetwork = new Network("defaultNetwork", NetworkArgs.builder()
.vpcName(name)
.cidrBlock("172.16.0.0/16")
.build());
var defaultSwitch = new Switch("defaultSwitch", SwitchArgs.builder()
.vpcId(defaultNetwork.id())
.cidrBlock("172.16.0.0/24")
.zoneId(defaultZones.applyValue(getZonesResult -> getZonesResult.ids()[0]))
.vswitchName(name)
.build());
var defaultInstance = new Instance("defaultInstance", InstanceArgs.builder()
.engine("MySQL")
.engineVersion("5.6")
.instanceType(defaultInstanceClasses.applyValue(getInstanceClassesResult -> getInstanceClassesResult.instanceClasses()[0].instanceClass()))
.instanceStorage("10")
.vswitchId(defaultSwitch.id())
.instanceName(name)
.build());
var defaultRdsAccount = new RdsAccount("defaultRdsAccount", RdsAccountArgs.builder()
.dbInstanceId(defaultInstance.id())
.accountName(name)
.accountPassword("Example1234")
.build());
}
}

Import

RDS Account can be imported using the id, e.g.

$ pulumi import alicloud:rds/rdsAccount:RdsAccount example <db_instance_id>:<account_name>

Properties

Link copied to clipboard

Database 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>

Operation account requiring a uniqueness check. It may consist of lower case letters, numbers, and underlines, and must start with a letter and end with letters or numbers, The length must be 2-63 characters for PostgreSQL, otherwise the length must be 2-32 characters.

Link copied to clipboard
val accountPassword: Output<String>

Operation password. It may consist of letters, digits, or underlines, with a length of 6 to 32 characters. You have to specify one of password and kms_encrypted_password fields.

Link copied to clipboard
val accountType: Output<String>

Privilege type of account. Default to Normal. Normal: Common privilege. Super: High privilege.

Link copied to clipboard
val dbInstanceId: Output<String>

The Id of instance in which account belongs.

Link copied to clipboard
val description: Output<String>

The attribute has been deprecated from 1.120.0 and using account_description instead.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val instanceId: Output<String>

The attribute has been deprecated from 1.120.0 and using db_instance_id instead.

Link copied to clipboard

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

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.

Link copied to clipboard
val name: Output<String>

The attribute has been deprecated from 1.120.0 and using account_name instead.

Link copied to clipboard
val password: Output<String>

The attribute has been deprecated from 1.120.0 and using account_password instead.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Resets permissions flag of the privileged account. Default to false. Set it to true can resets permissions of the privileged account.

Link copied to clipboard
val status: Output<String>

The status of the resource. Valid values: Available, Unavailable.

Link copied to clipboard
val type: Output<String>

The attribute has been deprecated from 1.120.0 and using account_type instead.

Link copied to clipboard
val urn: Output<String>