1. Packages
  2. Volcengine
  3. API Docs
  4. rds
  5. AccountPrivilege
Volcengine v0.0.23 published on Wednesday, Jan 3, 2024 by Volcengine

volcengine.rds.AccountPrivilege

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.23 published on Wednesday, Jan 3, 2024 by Volcengine

    (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 = 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.

    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:

    AccountName 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.
    DbPrivileges List<Volcengine.AccountPrivilegeDbPrivilege>
    The privileges of the account.
    InstanceId string
    The ID of the RDS instance.
    AccountName 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.
    DbPrivileges []AccountPrivilegeDbPrivilegeArgs
    The privileges of the account.
    InstanceId string
    The ID of the RDS instance.
    accountName 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.
    dbPrivileges List<AccountPrivilegeDbPrivilege>
    The privileges of the account.
    instanceId String
    The ID of the RDS instance.
    accountName 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.
    dbPrivileges AccountPrivilegeDbPrivilege[]
    The privileges of the account.
    instanceId 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[AccountPrivilegeDbPrivilegeArgs]
    The privileges of the account.
    instance_id str
    The ID of the RDS instance.
    accountName 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.
    dbPrivileges List<Property Map>
    The privileges of the account.
    instanceId 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.
    The following state arguments are supported:
    AccountName 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.
    DbPrivileges List<Volcengine.AccountPrivilegeDbPrivilege>
    The privileges of the account.
    InstanceId string
    The ID of the RDS instance.
    AccountName 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.
    DbPrivileges []AccountPrivilegeDbPrivilegeArgs
    The privileges of the account.
    InstanceId string
    The ID of the RDS instance.
    accountName 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.
    dbPrivileges List<AccountPrivilegeDbPrivilege>
    The privileges of the account.
    instanceId String
    The ID of the RDS instance.
    accountName 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.
    dbPrivileges AccountPrivilegeDbPrivilege[]
    The privileges of the account.
    instanceId 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[AccountPrivilegeDbPrivilegeArgs]
    The privileges of the account.
    instance_id str
    The ID of the RDS instance.
    accountName 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.
    dbPrivileges List<Property Map>
    The privileges of the account.
    instanceId String
    The ID of the RDS instance.

    Supporting Types

    AccountPrivilegeDbPrivilege, AccountPrivilegeDbPrivilegeArgs

    AccountPrivilege string
    The privilege type of the account.
    DbName string
    The name of database.
    AccountPrivilegeStr string
    The privilege string of the account.
    AccountPrivilege string
    The privilege type of the account.
    DbName string
    The name of database.
    AccountPrivilegeStr string
    The privilege string of the account.
    accountPrivilege String
    The privilege type of the account.
    dbName String
    The name of database.
    accountPrivilegeStr String
    The privilege string of the account.
    accountPrivilege string
    The privilege type of the account.
    dbName string
    The name of database.
    accountPrivilegeStr string
    The privilege string of the account.
    account_privilege str
    The privilege type of the account.
    db_name str
    The name of database.
    account_privilege_str str
    The privilege string of the account.
    accountPrivilege String
    The privilege type of the account.
    dbName String
    The name of database.
    accountPrivilegeStr String
    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.
    volcengine logo
    Volcengine v0.0.23 published on Wednesday, Jan 3, 2024 by Volcengine