volcengine.vedb_mysql.Account
Explore with Pulumi AI
Provides a resource to manage vedb mysql account
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";
const fooZones = volcengine.ecs.Zones({});
const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
vpcName: "acc-test-vpc",
cidrBlock: "172.16.0.0/16",
});
const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
subnetName: "acc-test-subnet",
cidrBlock: "172.16.0.0/24",
zoneId: fooZones.then(fooZones => fooZones.zones?.[2]?.id),
vpcId: fooVpc.id,
});
const fooInstance = new volcengine.vedb_mysql.Instance("fooInstance", {
chargeType: "PostPaid",
storageChargeType: "PostPaid",
dbEngineVersion: "MySQL_8_0",
dbMinorVersion: "3.0",
nodeNumber: 2,
nodeSpec: "vedb.mysql.x4.large",
subnetId: fooSubnet.id,
instanceName: "tf-test",
projectName: "testA",
tags: [
{
key: "tftest",
value: "tftest",
},
{
key: "tftest2",
value: "tftest2",
},
],
});
const fooDatabase = new volcengine.vedb_mysql.Database("fooDatabase", {
dbName: "tf-table",
instanceId: fooInstance.id,
});
const fooAccount = new volcengine.vedb_mysql.Account("fooAccount", {
accountName: "tftest",
accountPassword: "93f0cb0614Aab12",
accountType: "Normal",
instanceId: fooInstance.id,
accountPrivileges: [{
dbName: fooDatabase.dbName,
accountPrivilege: "Custom",
accountPrivilegeDetail: "SELECT,INSERT,DELETE",
}],
});
import pulumi
import pulumi_volcengine as volcengine
foo_zones = volcengine.ecs.zones()
foo_vpc = volcengine.vpc.Vpc("fooVpc",
vpc_name="acc-test-vpc",
cidr_block="172.16.0.0/16")
foo_subnet = volcengine.vpc.Subnet("fooSubnet",
subnet_name="acc-test-subnet",
cidr_block="172.16.0.0/24",
zone_id=foo_zones.zones[2].id,
vpc_id=foo_vpc.id)
foo_instance = volcengine.vedb_mysql.Instance("fooInstance",
charge_type="PostPaid",
storage_charge_type="PostPaid",
db_engine_version="MySQL_8_0",
db_minor_version="3.0",
node_number=2,
node_spec="vedb.mysql.x4.large",
subnet_id=foo_subnet.id,
instance_name="tf-test",
project_name="testA",
tags=[
volcengine.vedb_mysql.InstanceTagArgs(
key="tftest",
value="tftest",
),
volcengine.vedb_mysql.InstanceTagArgs(
key="tftest2",
value="tftest2",
),
])
foo_database = volcengine.vedb_mysql.Database("fooDatabase",
db_name="tf-table",
instance_id=foo_instance.id)
foo_account = volcengine.vedb_mysql.Account("fooAccount",
account_name="tftest",
account_password="93f0cb0614Aab12",
account_type="Normal",
instance_id=foo_instance.id,
account_privileges=[volcengine.vedb_mysql.AccountAccountPrivilegeArgs(
db_name=foo_database.db_name,
account_privilege="Custom",
account_privilege_detail="SELECT,INSERT,DELETE",
)])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vedb_mysql"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
fooZones, err := ecs.Zones(ctx, nil, nil)
if err != nil {
return err
}
fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
VpcName: pulumi.String("acc-test-vpc"),
CidrBlock: pulumi.String("172.16.0.0/16"),
})
if err != nil {
return err
}
fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
SubnetName: pulumi.String("acc-test-subnet"),
CidrBlock: pulumi.String("172.16.0.0/24"),
ZoneId: pulumi.String(fooZones.Zones[2].Id),
VpcId: fooVpc.ID(),
})
if err != nil {
return err
}
fooInstance, err := vedb_mysql.NewInstance(ctx, "fooInstance", &vedb_mysql.InstanceArgs{
ChargeType: pulumi.String("PostPaid"),
StorageChargeType: pulumi.String("PostPaid"),
DbEngineVersion: pulumi.String("MySQL_8_0"),
DbMinorVersion: pulumi.String("3.0"),
NodeNumber: pulumi.Int(2),
NodeSpec: pulumi.String("vedb.mysql.x4.large"),
SubnetId: fooSubnet.ID(),
InstanceName: pulumi.String("tf-test"),
ProjectName: pulumi.String("testA"),
Tags: vedb_mysql.InstanceTagArray{
&vedb_mysql.InstanceTagArgs{
Key: pulumi.String("tftest"),
Value: pulumi.String("tftest"),
},
&vedb_mysql.InstanceTagArgs{
Key: pulumi.String("tftest2"),
Value: pulumi.String("tftest2"),
},
},
})
if err != nil {
return err
}
fooDatabase, err := vedb_mysql.NewDatabase(ctx, "fooDatabase", &vedb_mysql.DatabaseArgs{
DbName: pulumi.String("tf-table"),
InstanceId: fooInstance.ID(),
})
if err != nil {
return err
}
_, err = vedb_mysql.NewAccount(ctx, "fooAccount", &vedb_mysql.AccountArgs{
AccountName: pulumi.String("tftest"),
AccountPassword: pulumi.String("93f0cb0614Aab12"),
AccountType: pulumi.String("Normal"),
InstanceId: fooInstance.ID(),
AccountPrivileges: vedb_mysql.AccountAccountPrivilegeArray{
&vedb_mysql.AccountAccountPrivilegeArgs{
DbName: fooDatabase.DbName,
AccountPrivilege: pulumi.String("Custom"),
AccountPrivilegeDetail: pulumi.String("SELECT,INSERT,DELETE"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var fooZones = Volcengine.Ecs.Zones.Invoke();
var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
{
VpcName = "acc-test-vpc",
CidrBlock = "172.16.0.0/16",
});
var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
{
SubnetName = "acc-test-subnet",
CidrBlock = "172.16.0.0/24",
ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[2]?.Id),
VpcId = fooVpc.Id,
});
var fooInstance = new Volcengine.Vedb_mysql.Instance("fooInstance", new()
{
ChargeType = "PostPaid",
StorageChargeType = "PostPaid",
DbEngineVersion = "MySQL_8_0",
DbMinorVersion = "3.0",
NodeNumber = 2,
NodeSpec = "vedb.mysql.x4.large",
SubnetId = fooSubnet.Id,
InstanceName = "tf-test",
ProjectName = "testA",
Tags = new[]
{
new Volcengine.Vedb_mysql.Inputs.InstanceTagArgs
{
Key = "tftest",
Value = "tftest",
},
new Volcengine.Vedb_mysql.Inputs.InstanceTagArgs
{
Key = "tftest2",
Value = "tftest2",
},
},
});
var fooDatabase = new Volcengine.Vedb_mysql.Database("fooDatabase", new()
{
DbName = "tf-table",
InstanceId = fooInstance.Id,
});
var fooAccount = new Volcengine.Vedb_mysql.Account("fooAccount", new()
{
AccountName = "tftest",
AccountPassword = "93f0cb0614Aab12",
AccountType = "Normal",
InstanceId = fooInstance.Id,
AccountPrivileges = new[]
{
new Volcengine.Vedb_mysql.Inputs.AccountAccountPrivilegeArgs
{
DbName = fooDatabase.DbName,
AccountPrivilege = "Custom",
AccountPrivilegeDetail = "SELECT,INSERT,DELETE",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ecs.EcsFunctions;
import com.pulumi.volcengine.ecs.inputs.ZonesArgs;
import com.pulumi.volcengine.vpc.Vpc;
import com.pulumi.volcengine.vpc.VpcArgs;
import com.pulumi.volcengine.vpc.Subnet;
import com.pulumi.volcengine.vpc.SubnetArgs;
import com.pulumi.volcengine.vedb_mysql.Instance;
import com.pulumi.volcengine.vedb_mysql.InstanceArgs;
import com.pulumi.volcengine.vedb_mysql.inputs.InstanceTagArgs;
import com.pulumi.volcengine.vedb_mysql.Database;
import com.pulumi.volcengine.vedb_mysql.DatabaseArgs;
import com.pulumi.volcengine.vedb_mysql.Account;
import com.pulumi.volcengine.vedb_mysql.AccountArgs;
import com.pulumi.volcengine.vedb_mysql.inputs.AccountAccountPrivilegeArgs;
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 fooZones = EcsFunctions.Zones();
var fooVpc = new Vpc("fooVpc", VpcArgs.builder()
.vpcName("acc-test-vpc")
.cidrBlock("172.16.0.0/16")
.build());
var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()
.subnetName("acc-test-subnet")
.cidrBlock("172.16.0.0/24")
.zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[2].id()))
.vpcId(fooVpc.id())
.build());
var fooInstance = new Instance("fooInstance", InstanceArgs.builder()
.chargeType("PostPaid")
.storageChargeType("PostPaid")
.dbEngineVersion("MySQL_8_0")
.dbMinorVersion("3.0")
.nodeNumber(2)
.nodeSpec("vedb.mysql.x4.large")
.subnetId(fooSubnet.id())
.instanceName("tf-test")
.projectName("testA")
.tags(
InstanceTagArgs.builder()
.key("tftest")
.value("tftest")
.build(),
InstanceTagArgs.builder()
.key("tftest2")
.value("tftest2")
.build())
.build());
var fooDatabase = new Database("fooDatabase", DatabaseArgs.builder()
.dbName("tf-table")
.instanceId(fooInstance.id())
.build());
var fooAccount = new Account("fooAccount", AccountArgs.builder()
.accountName("tftest")
.accountPassword("93f0cb0614Aab12")
.accountType("Normal")
.instanceId(fooInstance.id())
.accountPrivileges(AccountAccountPrivilegeArgs.builder()
.dbName(fooDatabase.dbName())
.accountPrivilege("Custom")
.accountPrivilegeDetail("SELECT,INSERT,DELETE")
.build())
.build());
}
}
resources:
fooVpc:
type: volcengine:vpc:Vpc
properties:
vpcName: acc-test-vpc
cidrBlock: 172.16.0.0/16
fooSubnet:
type: volcengine:vpc:Subnet
properties:
subnetName: acc-test-subnet
cidrBlock: 172.16.0.0/24
zoneId: ${fooZones.zones[2].id}
vpcId: ${fooVpc.id}
fooInstance:
type: volcengine:vedb_mysql:Instance
properties:
chargeType: PostPaid
storageChargeType: PostPaid
dbEngineVersion: MySQL_8_0
dbMinorVersion: '3.0'
nodeNumber: 2
nodeSpec: vedb.mysql.x4.large
subnetId: ${fooSubnet.id}
instanceName: tf-test
projectName: testA
tags:
- key: tftest
value: tftest
- key: tftest2
value: tftest2
fooDatabase:
type: volcengine:vedb_mysql:Database
properties:
dbName: tf-table
instanceId: ${fooInstance.id}
fooAccount:
type: volcengine:vedb_mysql:Account
properties:
accountName: tftest
accountPassword: 93f0cb0614Aab12
accountType: Normal
instanceId: ${fooInstance.id}
accountPrivileges:
- dbName: ${fooDatabase.dbName}
accountPrivilege: Custom
accountPrivilegeDetail: SELECT,INSERT,DELETE
variables:
fooZones:
fn::invoke:
Function: volcengine:ecs:Zones
Arguments: {}
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,
account_password: Optional[str] = None,
account_type: Optional[str] = None,
instance_id: Optional[str] = None,
account_privileges: Optional[Sequence[AccountAccountPrivilegeArgs]] = 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: volcengine:vedb_mysql: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 exampleaccountResourceResourceFromVedb_mysqlaccount = new Volcengine.Vedb_mysql.Account("exampleaccountResourceResourceFromVedb_mysqlaccount", new()
{
AccountName = "string",
AccountPassword = "string",
AccountType = "string",
InstanceId = "string",
AccountPrivileges = new[]
{
new Volcengine.Vedb_mysql.Inputs.AccountAccountPrivilegeArgs
{
AccountPrivilege = "string",
DbName = "string",
AccountPrivilegeDetail = "string",
},
},
});
example, err := vedb_mysql.NewAccount(ctx, "exampleaccountResourceResourceFromVedb_mysqlaccount", &vedb_mysql.AccountArgs{
AccountName: pulumi.String("string"),
AccountPassword: pulumi.String("string"),
AccountType: pulumi.String("string"),
InstanceId: pulumi.String("string"),
AccountPrivileges: vedb_mysql.AccountAccountPrivilegeArray{
&vedb_mysql.AccountAccountPrivilegeArgs{
AccountPrivilege: pulumi.String("string"),
DbName: pulumi.String("string"),
AccountPrivilegeDetail: pulumi.String("string"),
},
},
})
var exampleaccountResourceResourceFromVedb_mysqlaccount = new Account("exampleaccountResourceResourceFromVedb_mysqlaccount", AccountArgs.builder()
.accountName("string")
.accountPassword("string")
.accountType("string")
.instanceId("string")
.accountPrivileges(AccountAccountPrivilegeArgs.builder()
.accountPrivilege("string")
.dbName("string")
.accountPrivilegeDetail("string")
.build())
.build());
exampleaccount_resource_resource_from_vedb_mysqlaccount = volcengine.vedb_mysql.Account("exampleaccountResourceResourceFromVedb_mysqlaccount",
account_name="string",
account_password="string",
account_type="string",
instance_id="string",
account_privileges=[{
"account_privilege": "string",
"db_name": "string",
"account_privilege_detail": "string",
}])
const exampleaccountResourceResourceFromVedb_mysqlaccount = new volcengine.vedb_mysql.Account("exampleaccountResourceResourceFromVedb_mysqlaccount", {
accountName: "string",
accountPassword: "string",
accountType: "string",
instanceId: "string",
accountPrivileges: [{
accountPrivilege: "string",
dbName: "string",
accountPrivilegeDetail: "string",
}],
});
type: volcengine:vedb_mysql:Account
properties:
accountName: string
accountPassword: string
accountPrivileges:
- accountPrivilege: string
accountPrivilegeDetail: string
dbName: string
accountType: string
instanceId: 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:
- Account
Name string - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- Account
Password string - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- Account
Type string - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- Instance
Id string - The id of the instance.
- Account
Privileges List<AccountAccount Privilege> - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- Account
Name string - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- Account
Password string - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- Account
Type string - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- Instance
Id string - The id of the instance.
- Account
Privileges []AccountAccount Privilege Args - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- account
Name String - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- account
Password String - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- account
Type String - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- instance
Id String - The id of the instance.
- account
Privileges List<AccountAccount Privilege> - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- account
Name string - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- account
Password string - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- account
Type string - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- instance
Id string - The id of the instance.
- account
Privileges AccountAccount Privilege[] - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- account_
name str - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- account_
password str - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- account_
type str - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- instance_
id str - The id of the instance.
- account_
privileges Sequence[AccountAccount Privilege Args] - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- account
Name String - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- account
Password String - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- account
Type String - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- instance
Id String - The id of the instance.
- account
Privileges List<Property Map> - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
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.
- 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 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_name: Optional[str] = None,
account_password: Optional[str] = None,
account_privileges: Optional[Sequence[AccountAccountPrivilegeArgs]] = None,
account_type: Optional[str] = None,
instance_id: 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: volcengine:vedb_mysql: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.
- Account
Name string - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- Account
Password string - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- Account
Privileges List<AccountAccount Privilege> - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- Account
Type string - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- Instance
Id string - The id of the instance.
- Account
Name string - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- Account
Password string - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- Account
Privileges []AccountAccount Privilege Args - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- Account
Type string - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- Instance
Id string - The id of the instance.
- account
Name String - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- account
Password String - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- account
Privileges List<AccountAccount Privilege> - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- account
Type String - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- instance
Id String - The id of the instance.
- account
Name string - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- account
Password string - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- account
Privileges AccountAccount Privilege[] - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- account
Type string - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- instance
Id string - The id of the instance.
- account_
name str - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- account_
password str - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- account_
privileges Sequence[AccountAccount Privilege Args] - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- account_
type str - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- instance_
id str - The id of the instance.
- account
Name String - Database account name. The account name must meet the following requirements: The name is unique and within 2 to 32 characters in length. Consists of lowercase letters, numbers, or underscores (_). Starts with a lowercase letter and ends with a letter or number. The name cannot contain certain prohibited words. For detailed information, please refer to prohibited keywords. And certain reserved words such as root, admin, etc. cannot be used.
- account
Password String - Password of database account. The account password must meet the following requirements: It can only contain upper and lower case letters, numbers and the following special characters _#!@$%^&*()+=-. It must be within 8 to 32 characters in length. It must contain at least three of upper case letters, lower case letters, numbers or special characters.
- account
Privileges List<Property Map> - Database permission information. When the value of AccountType is Super, this parameter does not need to be passed. High-privilege accounts by default have all permissions for all databases under this instance. When the value of AccountType is Normal, it is recommended to pass this parameter to grant specified permissions for specified databases to ordinary accounts. If not set, this account does not have any permissions for any database.
- account
Type String - Database account type. Values: Super: High-privilege account. Only one high-privilege account can be created for an instance. It has all permissions for all databases under this instance and can manage all ordinary accounts and databases. Normal: Multiple ordinary accounts can be created for an instance. Specific database permissions need to be manually granted to ordinary accounts.
- instance
Id String - The id of the instance.
Supporting Types
AccountAccountPrivilege, AccountAccountPrivilegeArgs
- Account
Privilege string - Authorization database privilege types: ReadWrite: Read and write privilege. ReadOnly: Read-only privilege. DDLOnly: Only DDL privilege. DMLOnly: Only DML privilege. Custom: Custom privilege.
- Db
Name string - Database name requiring authorization.
- Account
Privilege stringDetail - The specific SQL operation permissions contained in the permission type are separated by English commas (,) between multiple strings. When used as a request parameter in the CreateDatabase interface, when the AccountPrivilege value is Custom, this parameter is required. Value range (multiple selections allowed): SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER. When used as a return parameter in the DescribeDatabases interface, regardless of the value of AccountPrivilege, the details of the SQL operation permissions contained in this permission type are returned. For the specific SQL operation permissions contained in each permission type, please refer to the account permission list.
- Account
Privilege string - Authorization database privilege types: ReadWrite: Read and write privilege. ReadOnly: Read-only privilege. DDLOnly: Only DDL privilege. DMLOnly: Only DML privilege. Custom: Custom privilege.
- Db
Name string - Database name requiring authorization.
- Account
Privilege stringDetail - The specific SQL operation permissions contained in the permission type are separated by English commas (,) between multiple strings. When used as a request parameter in the CreateDatabase interface, when the AccountPrivilege value is Custom, this parameter is required. Value range (multiple selections allowed): SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER. When used as a return parameter in the DescribeDatabases interface, regardless of the value of AccountPrivilege, the details of the SQL operation permissions contained in this permission type are returned. For the specific SQL operation permissions contained in each permission type, please refer to the account permission list.
- account
Privilege String - Authorization database privilege types: ReadWrite: Read and write privilege. ReadOnly: Read-only privilege. DDLOnly: Only DDL privilege. DMLOnly: Only DML privilege. Custom: Custom privilege.
- db
Name String - Database name requiring authorization.
- account
Privilege StringDetail - The specific SQL operation permissions contained in the permission type are separated by English commas (,) between multiple strings. When used as a request parameter in the CreateDatabase interface, when the AccountPrivilege value is Custom, this parameter is required. Value range (multiple selections allowed): SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER. When used as a return parameter in the DescribeDatabases interface, regardless of the value of AccountPrivilege, the details of the SQL operation permissions contained in this permission type are returned. For the specific SQL operation permissions contained in each permission type, please refer to the account permission list.
- account
Privilege string - Authorization database privilege types: ReadWrite: Read and write privilege. ReadOnly: Read-only privilege. DDLOnly: Only DDL privilege. DMLOnly: Only DML privilege. Custom: Custom privilege.
- db
Name string - Database name requiring authorization.
- account
Privilege stringDetail - The specific SQL operation permissions contained in the permission type are separated by English commas (,) between multiple strings. When used as a request parameter in the CreateDatabase interface, when the AccountPrivilege value is Custom, this parameter is required. Value range (multiple selections allowed): SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER. When used as a return parameter in the DescribeDatabases interface, regardless of the value of AccountPrivilege, the details of the SQL operation permissions contained in this permission type are returned. For the specific SQL operation permissions contained in each permission type, please refer to the account permission list.
- account_
privilege str - Authorization database privilege types: ReadWrite: Read and write privilege. ReadOnly: Read-only privilege. DDLOnly: Only DDL privilege. DMLOnly: Only DML privilege. Custom: Custom privilege.
- db_
name str - Database name requiring authorization.
- account_
privilege_ strdetail - The specific SQL operation permissions contained in the permission type are separated by English commas (,) between multiple strings. When used as a request parameter in the CreateDatabase interface, when the AccountPrivilege value is Custom, this parameter is required. Value range (multiple selections allowed): SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER. When used as a return parameter in the DescribeDatabases interface, regardless of the value of AccountPrivilege, the details of the SQL operation permissions contained in this permission type are returned. For the specific SQL operation permissions contained in each permission type, please refer to the account permission list.
- account
Privilege String - Authorization database privilege types: ReadWrite: Read and write privilege. ReadOnly: Read-only privilege. DDLOnly: Only DDL privilege. DMLOnly: Only DML privilege. Custom: Custom privilege.
- db
Name String - Database name requiring authorization.
- account
Privilege StringDetail - The specific SQL operation permissions contained in the permission type are separated by English commas (,) between multiple strings. When used as a request parameter in the CreateDatabase interface, when the AccountPrivilege value is Custom, this parameter is required. Value range (multiple selections allowed): SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER. When used as a return parameter in the DescribeDatabases interface, regardless of the value of AccountPrivilege, the details of the SQL operation permissions contained in this permission type are returned. For the specific SQL operation permissions contained in each permission type, please refer to the account permission list.
Import
VedbMysqlAccount can be imported using the instance id and account name, e.g.
$ pulumi import volcengine:vedb_mysql/account:Account default vedbm-r3xq0zdl****:testuser
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- volcengine volcengine/pulumi-volcengine
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
volcengine
Terraform Provider.