volcengine.rds.AccountPrivilege
Explore with Pulumi AI
(Deprecated! Recommend use volcengine_rds_mysql_*** replace) Provides a resource to manage rds account privilege
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() =>
{
var appName = new Volcengine.Rds.Account("appName", new()
{
InstanceId = "mysql-0fdd3bab2e7c",
AccountName = "terraform-test-app",
AccountPassword = "Aatest123",
AccountType = "Normal",
});
var foo = new Volcengine.Rds.AccountPrivilege("foo", new()
{
InstanceId = "mysql-0fdd3bab2e7c",
AccountName = appName.AccountName,
DbPrivileges = new[]
{
new Volcengine.Rds.Inputs.AccountPrivilegeDbPrivilegeArgs
{
DbName = "foo",
AccountPrivilege = "Custom",
AccountPrivilegeStr = "ALTER,ALTER ROUTINE,CREATE,CREATE ROUTINE,CREATE TEMPORARY TABLES",
},
new Volcengine.Rds.Inputs.AccountPrivilegeDbPrivilegeArgs
{
DbName = "bar",
AccountPrivilege = "DDLOnly",
},
new Volcengine.Rds.Inputs.AccountPrivilegeDbPrivilegeArgs
{
DbName = "demo",
AccountPrivilege = "ReadWrite",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/rds"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
appName, err := rds.NewAccount(ctx, "appName", &rds.AccountArgs{
InstanceId: pulumi.String("mysql-0fdd3bab2e7c"),
AccountName: pulumi.String("terraform-test-app"),
AccountPassword: pulumi.String("Aatest123"),
AccountType: pulumi.String("Normal"),
})
if err != nil {
return err
}
_, err = rds.NewAccountPrivilege(ctx, "foo", &rds.AccountPrivilegeArgs{
InstanceId: pulumi.String("mysql-0fdd3bab2e7c"),
AccountName: appName.AccountName,
DbPrivileges: rds.AccountPrivilegeDbPrivilegeArray{
&rds.AccountPrivilegeDbPrivilegeArgs{
DbName: pulumi.String("foo"),
AccountPrivilege: pulumi.String("Custom"),
AccountPrivilegeStr: pulumi.String("ALTER,ALTER ROUTINE,CREATE,CREATE ROUTINE,CREATE TEMPORARY TABLES"),
},
&rds.AccountPrivilegeDbPrivilegeArgs{
DbName: pulumi.String("bar"),
AccountPrivilege: pulumi.String("DDLOnly"),
},
&rds.AccountPrivilegeDbPrivilegeArgs{
DbName: pulumi.String("demo"),
AccountPrivilege: pulumi.String("ReadWrite"),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.rds.Account;
import com.pulumi.volcengine.rds.AccountArgs;
import com.pulumi.volcengine.rds.AccountPrivilege;
import com.pulumi.volcengine.rds.AccountPrivilegeArgs;
import com.pulumi.volcengine.rds.inputs.AccountPrivilegeDbPrivilegeArgs;
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) {
var appName = new Account("appName", AccountArgs.builder()
.instanceId("mysql-0fdd3bab2e7c")
.accountName("terraform-test-app")
.accountPassword("Aatest123")
.accountType("Normal")
.build());
var foo = new AccountPrivilege("foo", AccountPrivilegeArgs.builder()
.instanceId("mysql-0fdd3bab2e7c")
.accountName(appName.accountName())
.dbPrivileges(
AccountPrivilegeDbPrivilegeArgs.builder()
.dbName("foo")
.accountPrivilege("Custom")
.accountPrivilegeStr("ALTER,ALTER ROUTINE,CREATE,CREATE ROUTINE,CREATE TEMPORARY TABLES")
.build(),
AccountPrivilegeDbPrivilegeArgs.builder()
.dbName("bar")
.accountPrivilege("DDLOnly")
.build(),
AccountPrivilegeDbPrivilegeArgs.builder()
.dbName("demo")
.accountPrivilege("ReadWrite")
.build())
.build());
}
}
import pulumi
import pulumi_volcengine as volcengine
app_name = volcengine.rds.Account("appName",
instance_id="mysql-0fdd3bab2e7c",
account_name="terraform-test-app",
account_password="Aatest123",
account_type="Normal")
foo = volcengine.rds.AccountPrivilege("foo",
instance_id="mysql-0fdd3bab2e7c",
account_name=app_name.account_name,
db_privileges=[
volcengine.rds.AccountPrivilegeDbPrivilegeArgs(
db_name="foo",
account_privilege="Custom",
account_privilege_str="ALTER,ALTER ROUTINE,CREATE,CREATE ROUTINE,CREATE TEMPORARY TABLES",
),
volcengine.rds.AccountPrivilegeDbPrivilegeArgs(
db_name="bar",
account_privilege="DDLOnly",
),
volcengine.rds.AccountPrivilegeDbPrivilegeArgs(
db_name="demo",
account_privilege="ReadWrite",
),
])
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@volcengine/pulumi";
const appName = new volcengine.rds.Account("appName", {
instanceId: "mysql-0fdd3bab2e7c",
accountName: "terraform-test-app",
accountPassword: "Aatest123",
accountType: "Normal",
});
const foo = new volcengine.rds.AccountPrivilege("foo", {
instanceId: "mysql-0fdd3bab2e7c",
accountName: appName.accountName,
dbPrivileges: [
{
dbName: "foo",
accountPrivilege: "Custom",
accountPrivilegeStr: "ALTER,ALTER ROUTINE,CREATE,CREATE ROUTINE,CREATE TEMPORARY TABLES",
},
{
dbName: "bar",
accountPrivilege: "DDLOnly",
},
{
dbName: "demo",
accountPrivilege: "ReadWrite",
},
],
});
resources:
appName:
type: volcengine:rds:Account
properties:
instanceId: mysql-0fdd3bab2e7c
accountName: terraform-test-app
accountPassword: Aatest123
accountType: Normal
foo:
type: volcengine:rds:AccountPrivilege
properties:
instanceId: mysql-0fdd3bab2e7c
accountName: ${appName.accountName}
dbPrivileges:
- dbName: foo
accountPrivilege: Custom
accountPrivilegeStr: ALTER,ALTER ROUTINE,CREATE,CREATE ROUTINE,CREATE TEMPORARY TABLES
- dbName: bar
accountPrivilege: DDLOnly
- dbName: demo
accountPrivilege: ReadWrite
Create AccountPrivilege Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AccountPrivilege(name: string, args: AccountPrivilegeArgs, opts?: CustomResourceOptions);
@overload
def AccountPrivilege(resource_name: str,
args: AccountPrivilegeArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AccountPrivilege(resource_name: str,
opts: Optional[ResourceOptions] = None,
account_name: Optional[str] = None,
db_privileges: Optional[Sequence[AccountPrivilegeDbPrivilegeArgs]] = None,
instance_id: Optional[str] = None)
func NewAccountPrivilege(ctx *Context, name string, args AccountPrivilegeArgs, opts ...ResourceOption) (*AccountPrivilege, error)
public AccountPrivilege(string name, AccountPrivilegeArgs args, CustomResourceOptions? opts = null)
public AccountPrivilege(String name, AccountPrivilegeArgs args)
public AccountPrivilege(String name, AccountPrivilegeArgs args, CustomResourceOptions options)
type: volcengine:rds:AccountPrivilege
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 AccountPrivilegeArgs
- 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 AccountPrivilegeArgs
- 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 AccountPrivilegeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AccountPrivilegeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AccountPrivilegeArgs
- 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 accountPrivilegeResource = new Volcengine.Rds.AccountPrivilege("accountPrivilegeResource", new()
{
AccountName = "string",
DbPrivileges = new[]
{
new Volcengine.Rds.Inputs.AccountPrivilegeDbPrivilegeArgs
{
AccountPrivilege = "string",
DbName = "string",
AccountPrivilegeStr = "string",
},
},
InstanceId = "string",
});
example, err := rds.NewAccountPrivilege(ctx, "accountPrivilegeResource", &rds.AccountPrivilegeArgs{
AccountName: pulumi.String("string"),
DbPrivileges: rds.AccountPrivilegeDbPrivilegeArray{
&rds.AccountPrivilegeDbPrivilegeArgs{
AccountPrivilege: pulumi.String("string"),
DbName: pulumi.String("string"),
AccountPrivilegeStr: pulumi.String("string"),
},
},
InstanceId: pulumi.String("string"),
})
var accountPrivilegeResource = new AccountPrivilege("accountPrivilegeResource", AccountPrivilegeArgs.builder()
.accountName("string")
.dbPrivileges(AccountPrivilegeDbPrivilegeArgs.builder()
.accountPrivilege("string")
.dbName("string")
.accountPrivilegeStr("string")
.build())
.instanceId("string")
.build());
account_privilege_resource = volcengine.rds.AccountPrivilege("accountPrivilegeResource",
account_name="string",
db_privileges=[volcengine.rds.AccountPrivilegeDbPrivilegeArgs(
account_privilege="string",
db_name="string",
account_privilege_str="string",
)],
instance_id="string")
const accountPrivilegeResource = new volcengine.rds.AccountPrivilege("accountPrivilegeResource", {
accountName: "string",
dbPrivileges: [{
accountPrivilege: "string",
dbName: "string",
accountPrivilegeStr: "string",
}],
instanceId: "string",
});
type: volcengine:rds:AccountPrivilege
properties:
accountName: string
dbPrivileges:
- accountPrivilege: string
accountPrivilegeStr: string
dbName: string
instanceId: string
AccountPrivilege Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The AccountPrivilege resource accepts the following input properties:
- Account
Name string - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- Db
Privileges List<AccountPrivilege Db Privilege> - The privileges of the account.
- Instance
Id string - The ID of the RDS instance.
- Account
Name string - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- Db
Privileges []AccountPrivilege Db Privilege Args - The privileges of the account.
- Instance
Id string - The ID of the RDS instance.
- account
Name String - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- db
Privileges List<AccountPrivilege Db Privilege> - The privileges of the account.
- instance
Id String - The ID of the RDS instance.
- account
Name string - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- db
Privileges AccountPrivilege Db Privilege[] - The privileges of the account.
- instance
Id string - The ID of the RDS instance.
- account_
name str - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- db_
privileges Sequence[AccountPrivilege Db Privilege Args] - The privileges of the account.
- instance_
id str - The ID of the RDS instance.
- account
Name String - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- db
Privileges List<Property Map> - The privileges of the account.
- instance
Id String - The ID of the RDS instance.
Outputs
All input properties are implicitly available as output properties. Additionally, the AccountPrivilege 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 AccountPrivilege Resource
Get an existing AccountPrivilege 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?: AccountPrivilegeState, opts?: CustomResourceOptions): AccountPrivilege
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_name: Optional[str] = None,
db_privileges: Optional[Sequence[AccountPrivilegeDbPrivilegeArgs]] = None,
instance_id: Optional[str] = None) -> AccountPrivilege
func GetAccountPrivilege(ctx *Context, name string, id IDInput, state *AccountPrivilegeState, opts ...ResourceOption) (*AccountPrivilege, error)
public static AccountPrivilege Get(string name, Input<string> id, AccountPrivilegeState? state, CustomResourceOptions? opts = null)
public static AccountPrivilege get(String name, Output<String> id, AccountPrivilegeState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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 rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- Db
Privileges List<AccountPrivilege Db Privilege> - The privileges of the account.
- Instance
Id string - The ID of the RDS instance.
- Account
Name string - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- Db
Privileges []AccountPrivilege Db Privilege Args - The privileges of the account.
- Instance
Id string - The ID of the RDS instance.
- account
Name String - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- db
Privileges List<AccountPrivilege Db Privilege> - The privileges of the account.
- instance
Id String - The ID of the RDS instance.
- account
Name string - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- db
Privileges AccountPrivilege Db Privilege[] - The privileges of the account.
- instance
Id string - The ID of the RDS instance.
- account_
name str - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- db_
privileges Sequence[AccountPrivilege Db Privilege Args] - The privileges of the account.
- instance_
id str - The ID of the RDS instance.
- account
Name String - Database account name. The rules are as follows: Unique name. Start with a letter and end with a letter or number. Consists of lowercase letters, numbers, or underscores (_). The length is 2~32 characters. The keyword list is disabled for database accounts, and certain reserved words, including root, admin, etc., cannot be used.
- db
Privileges List<Property Map> - The privileges of the account.
- instance
Id String - The ID of the RDS instance.
Supporting Types
AccountPrivilegeDbPrivilege, AccountPrivilegeDbPrivilegeArgs
- Account
Privilege string - The privilege type of the account.
- Db
Name string - The name of database.
- Account
Privilege stringStr - The privilege string of the account.
- Account
Privilege string - The privilege type of the account.
- Db
Name string - The name of database.
- Account
Privilege stringStr - The privilege string of the account.
- account
Privilege String - The privilege type of the account.
- db
Name String - The name of database.
- account
Privilege StringStr - The privilege string of the account.
- account
Privilege string - The privilege type of the account.
- db
Name string - The name of database.
- account
Privilege stringStr - The privilege string of the account.
- account_
privilege str - The privilege type of the account.
- db_
name str - The name of database.
- account_
privilege_ strstr - The privilege string of the account.
- account
Privilege String - The privilege type of the account.
- db
Name String - The name of database.
- account
Privilege StringStr - The privilege string of the account.
Import
RDS account privilege can be imported using the id, e.g.
$ pulumi import volcengine:rds/accountPrivilege:AccountPrivilege default mysql-42b38c769c4b:account_name
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.