Account
Provides an RDS account resource and used to manage databases.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var config = new Config();
var creation = config.Get("creation") ?? "Rds";
var name = config.Get("name") ?? "dbaccountmysql";
var defaultZones = Output.Create(AliCloud.GetZones.InvokeAsync(new AliCloud.GetZonesArgs
{
AvailableResourceCreation = creation,
}));
var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new AliCloud.Vpc.NetworkArgs
{
CidrBlock = "172.16.0.0/16",
});
var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new AliCloud.Vpc.SwitchArgs
{
AvailabilityZone = defaultZones.Apply(defaultZones => defaultZones.Zones[0].Id),
CidrBlock = "172.16.0.0/24",
VpcId = defaultNetwork.Id,
});
var instance = new AliCloud.Rds.Instance("instance", new AliCloud.Rds.InstanceArgs
{
Engine = "MySQL",
EngineVersion = "5.6",
InstanceName = name,
InstanceStorage = 10,
InstanceType = "rds.mysql.s1.small",
VswitchId = defaultSwitch.Id,
});
var account = new AliCloud.Rds.Account("account", new AliCloud.Rds.AccountArgs
{
InstanceId = instance.Id,
Password = "Test12345",
});
}
}
Coming soon!
import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
creation = config.get("creation")
if creation is None:
creation = "Rds"
name = config.get("name")
if name is None:
name = "dbaccountmysql"
default_zones = alicloud.get_zones(available_resource_creation=creation)
default_network = alicloud.vpc.Network("defaultNetwork", cidr_block="172.16.0.0/16")
default_switch = alicloud.vpc.Switch("defaultSwitch",
availability_zone=default_zones.zones[0]["id"],
cidr_block="172.16.0.0/24",
vpc_id=default_network.id)
instance = alicloud.rds.Instance("instance",
engine="MySQL",
engine_version="5.6",
instance_name=name,
instance_storage="10",
instance_type="rds.mysql.s1.small",
vswitch_id=default_switch.id)
account = alicloud.rds.Account("account",
instance_id=instance.id,
password="Test12345")import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const creation = config.get("creation") || "Rds";
const name = config.get("name") || "dbaccountmysql";
const defaultZones = pulumi.output(alicloud.getZones({
availableResourceCreation: creation,
}, { async: true }));
const defaultNetwork = new alicloud.vpc.Network("default", {
cidrBlock: "172.16.0.0/16",
});
const defaultSwitch = new alicloud.vpc.Switch("default", {
availabilityZone: defaultZones.zones[0].id,
cidrBlock: "172.16.0.0/24",
vpcId: defaultNetwork.id,
});
const instance = new alicloud.rds.Instance("instance", {
engine: "MySQL",
engineVersion: "5.6",
instanceName: name,
instanceStorage: 10,
instanceType: "rds.mysql.s1.small",
vswitchId: defaultSwitch.id,
});
const account = new alicloud.rds.Account("account", {
instanceId: instance.id,
password: "Test12345",
});Create a Account Resource
new Account(name: string, args: AccountArgs, opts?: CustomResourceOptions);def Account(resource_name, opts=None, description=None, instance_id=None, kms_encrypted_password=None, kms_encryption_context=None, name=None, password=None, type=None, __props__=None);func NewAccount(ctx *Context, name string, args AccountArgs, opts ...ResourceOption) (*Account, error)public Account(string name, AccountArgs args, CustomResourceOptions? opts = null)- 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.
- opts ResourceOptions
- A bag of options that control this 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.
Account Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Account resource accepts the following input properties:
- Instance
Id string The Id of instance in which account belongs.
- Description string
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.
- Kms
Encrypted stringPassword An KMS encrypts password used to a db account. If the
passwordis filled in, this field will be ignored.- Kms
Encryption Dictionary<string, object>Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating a db account withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set.- Name string
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.
- Password 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
passwordandkms_encrypted_passwordfields.- Type string
Privilege type of account. - Normal: Common privilege. - Super: High privilege.
- Instance
Id string The Id of instance in which account belongs.
- Description string
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.
- Kms
Encrypted stringPassword An KMS encrypts password used to a db account. If the
passwordis filled in, this field will be ignored.- Kms
Encryption map[string]interface{}Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating a db account withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set.- Name string
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.
- Password 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
passwordandkms_encrypted_passwordfields.- Type string
Privilege type of account. - Normal: Common privilege. - Super: High privilege.
- instance
Id string The Id of instance in which account belongs.
- description string
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.
- kms
Encrypted stringPassword An KMS encrypts password used to a db account. If the
passwordis filled in, this field will be ignored.- kms
Encryption {[key: string]: any}Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating a db account withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set.- name string
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.
- password 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
passwordandkms_encrypted_passwordfields.- type string
Privilege type of account. - Normal: Common privilege. - Super: High privilege.
- instance_
id str The Id of instance in which account belongs.
- description str
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.
- kms_
encrypted_ strpassword An KMS encrypts password used to a db account. If the
passwordis filled in, this field will be ignored.- kms_
encryption_ Dict[str, Any]context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating a db account withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set.- name str
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.
- password str
Operation password. It may consist of letters, digits, or underlines, with a length of 6 to 32 characters. You have to specify one of
passwordandkms_encrypted_passwordfields.- type str
Privilege type of account. - Normal: Common privilege. - Super: High privilege.
Outputs
All input properties are implicitly available as output properties. Additionally, the Account resource produces the following output properties:
Look up an 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): Accountstatic get(resource_name, id, opts=None, description=None, instance_id=None, kms_encrypted_password=None, kms_encryption_context=None, name=None, password=None, type=None, __props__=None);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)- 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.
The following state arguments are supported:
- Description string
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.
- Instance
Id string The Id of instance in which account belongs.
- Kms
Encrypted stringPassword An KMS encrypts password used to a db account. If the
passwordis filled in, this field will be ignored.- Kms
Encryption Dictionary<string, object>Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating a db account withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set.- Name string
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.
- Password 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
passwordandkms_encrypted_passwordfields.- Type string
Privilege type of account. - Normal: Common privilege. - Super: High privilege.
- Description string
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.
- Instance
Id string The Id of instance in which account belongs.
- Kms
Encrypted stringPassword An KMS encrypts password used to a db account. If the
passwordis filled in, this field will be ignored.- Kms
Encryption map[string]interface{}Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating a db account withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set.- Name string
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.
- Password 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
passwordandkms_encrypted_passwordfields.- Type string
Privilege type of account. - Normal: Common privilege. - Super: High privilege.
- description string
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.
- instance
Id string The Id of instance in which account belongs.
- kms
Encrypted stringPassword An KMS encrypts password used to a db account. If the
passwordis filled in, this field will be ignored.- kms
Encryption {[key: string]: any}Context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating a db account withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set.- name string
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.
- password 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
passwordandkms_encrypted_passwordfields.- type string
Privilege type of account. - Normal: Common privilege. - Super: High privilege.
- description str
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.
- instance_
id str The Id of instance in which account belongs.
- kms_
encrypted_ strpassword An KMS encrypts password used to a db account. If the
passwordis filled in, this field will be ignored.- kms_
encryption_ Dict[str, Any]context An KMS encryption context used to decrypt
kms_encrypted_passwordbefore creating or updating a db account withkms_encrypted_password. See Encryption Context. It is valid whenkms_encrypted_passwordis set.- name str
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.
- password str
Operation password. It may consist of letters, digits, or underlines, with a length of 6 to 32 characters. You have to specify one of
passwordandkms_encrypted_passwordfields.- type str
Privilege type of account. - Normal: Common privilege. - Super: High privilege.
Package Details
- Repository
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloudTerraform Provider.