1. Packages
  2. Volcengine
  3. API Docs
  4. rds_postgresql
  5. Account
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

volcengine.rds_postgresql.Account

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

    Provides a resource to manage rds postgresql account

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Volcengine.Rds_postgresql.Account("foo", new()
        {
            AccountName = "acc-test-account",
            AccountPassword = "93c@*****!ab12",
            AccountType = "Super",
            InstanceId = "postgres-954*****7233",
        });
    
        var foo1 = new Volcengine.Rds_postgresql.Account("foo1", new()
        {
            AccountName = "acc-test-account1",
            AccountPassword = "9wc@****b12",
            AccountPrivileges = "Inherit,Login,CreateRole,CreateDB",
            AccountType = "Normal",
            InstanceId = "postgres-95*****7233",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/rds_postgresql"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := rds_postgresql.NewAccount(ctx, "foo", &rds_postgresql.AccountArgs{
    			AccountName:     pulumi.String("acc-test-account"),
    			AccountPassword: pulumi.String("93c@*****!ab12"),
    			AccountType:     pulumi.String("Super"),
    			InstanceId:      pulumi.String("postgres-954*****7233"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = rds_postgresql.NewAccount(ctx, "foo1", &rds_postgresql.AccountArgs{
    			AccountName:       pulumi.String("acc-test-account1"),
    			AccountPassword:   pulumi.String("9wc@****b12"),
    			AccountPrivileges: pulumi.String("Inherit,Login,CreateRole,CreateDB"),
    			AccountType:       pulumi.String("Normal"),
    			InstanceId:        pulumi.String("postgres-95*****7233"),
    		})
    		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_postgresql.Account;
    import com.pulumi.volcengine.rds_postgresql.AccountArgs;
    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 foo = new Account("foo", AccountArgs.builder()        
                .accountName("acc-test-account")
                .accountPassword("93c@*****!ab12")
                .accountType("Super")
                .instanceId("postgres-954*****7233")
                .build());
    
            var foo1 = new Account("foo1", AccountArgs.builder()        
                .accountName("acc-test-account1")
                .accountPassword("9wc@****b12")
                .accountPrivileges("Inherit,Login,CreateRole,CreateDB")
                .accountType("Normal")
                .instanceId("postgres-95*****7233")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo = volcengine.rds_postgresql.Account("foo",
        account_name="acc-test-account",
        account_password="93c@*****!ab12",
        account_type="Super",
        instance_id="postgres-954*****7233")
    foo1 = volcengine.rds_postgresql.Account("foo1",
        account_name="acc-test-account1",
        account_password="9wc@****b12",
        account_privileges="Inherit,Login,CreateRole,CreateDB",
        account_type="Normal",
        instance_id="postgres-95*****7233")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const foo = new volcengine.rds_postgresql.Account("foo", {
        accountName: "acc-test-account",
        accountPassword: "93c@*****!ab12",
        accountType: "Super",
        instanceId: "postgres-954*****7233",
    });
    const foo1 = new volcengine.rds_postgresql.Account("foo1", {
        accountName: "acc-test-account1",
        accountPassword: "9wc@****b12",
        accountPrivileges: "Inherit,Login,CreateRole,CreateDB",
        accountType: "Normal",
        instanceId: "postgres-95*****7233",
    });
    
    resources:
      foo:
        type: volcengine:rds_postgresql:Account
        properties:
          accountName: acc-test-account
          accountPassword: 93c@*****!ab12
          accountType: Super
          instanceId: postgres-954*****7233
      foo1:
        type: volcengine:rds_postgresql:Account
        properties:
          accountName: acc-test-account1
          accountPassword: 9wc@****b12
          accountPrivileges: Inherit,Login,CreateRole,CreateDB
          accountType: Normal
          instanceId: postgres-95*****7233
    

    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[str] = 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:rds_postgresql: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 exampleaccountResourceResourceFromRds_postgresqlaccount = new Volcengine.Rds_postgresql.Account("exampleaccountResourceResourceFromRds_postgresqlaccount", new()
    {
        AccountName = "string",
        AccountPassword = "string",
        AccountType = "string",
        InstanceId = "string",
        AccountPrivileges = "string",
    });
    
    example, err := rds_postgresql.NewAccount(ctx, "exampleaccountResourceResourceFromRds_postgresqlaccount", &rds_postgresql.AccountArgs{
    	AccountName:       pulumi.String("string"),
    	AccountPassword:   pulumi.String("string"),
    	AccountType:       pulumi.String("string"),
    	InstanceId:        pulumi.String("string"),
    	AccountPrivileges: pulumi.String("string"),
    })
    
    var exampleaccountResourceResourceFromRds_postgresqlaccount = new Account("exampleaccountResourceResourceFromRds_postgresqlaccount", AccountArgs.builder()
        .accountName("string")
        .accountPassword("string")
        .accountType("string")
        .instanceId("string")
        .accountPrivileges("string")
        .build());
    
    exampleaccount_resource_resource_from_rds_postgresqlaccount = volcengine.rds_postgresql.Account("exampleaccountResourceResourceFromRds_postgresqlaccount",
        account_name="string",
        account_password="string",
        account_type="string",
        instance_id="string",
        account_privileges="string")
    
    const exampleaccountResourceResourceFromRds_postgresqlaccount = new volcengine.rds_postgresql.Account("exampleaccountResourceResourceFromRds_postgresqlaccount", {
        accountName: "string",
        accountPassword: "string",
        accountType: "string",
        instanceId: "string",
        accountPrivileges: "string",
    });
    
    type: volcengine:rds_postgresql:Account
    properties:
        accountName: string
        accountPassword: string
        accountPrivileges: 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

    The Account resource accepts the following input properties:

    AccountName string
    Database account name.
    AccountPassword string
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    AccountType string
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    InstanceId string
    The ID of the RDS instance.
    AccountPrivileges string
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    AccountName string
    Database account name.
    AccountPassword string
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    AccountType string
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    InstanceId string
    The ID of the RDS instance.
    AccountPrivileges string
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    accountName String
    Database account name.
    accountPassword String
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    accountType String
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    instanceId String
    The ID of the RDS instance.
    accountPrivileges String
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    accountName string
    Database account name.
    accountPassword string
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    accountType string
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    instanceId string
    The ID of the RDS instance.
    accountPrivileges string
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    account_name str
    Database account name.
    account_password str
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    account_type str
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    instance_id str
    The ID of the RDS instance.
    account_privileges str
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    accountName String
    Database account name.
    accountPassword String
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    accountType String
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    instanceId String
    The ID of the RDS instance.
    accountPrivileges String
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Account resource produces the following output properties:

    AccountStatus string
    The status of the database account.
    Id string
    The provider-assigned unique ID for this managed resource.
    AccountStatus string
    The status of the database account.
    Id string
    The provider-assigned unique ID for this managed resource.
    accountStatus String
    The status of the database account.
    id String
    The provider-assigned unique ID for this managed resource.
    accountStatus string
    The status of the database account.
    id string
    The provider-assigned unique ID for this managed resource.
    account_status str
    The status of the database account.
    id str
    The provider-assigned unique ID for this managed resource.
    accountStatus String
    The status of the database account.
    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[str] = None,
            account_status: Optional[str] = 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)
    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.
    AccountPassword string
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    AccountPrivileges string
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    AccountStatus string
    The status of the database account.
    AccountType string
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    InstanceId string
    The ID of the RDS instance.
    AccountName string
    Database account name.
    AccountPassword string
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    AccountPrivileges string
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    AccountStatus string
    The status of the database account.
    AccountType string
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    InstanceId string
    The ID of the RDS instance.
    accountName String
    Database account name.
    accountPassword String
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    accountPrivileges String
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    accountStatus String
    The status of the database account.
    accountType String
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    instanceId String
    The ID of the RDS instance.
    accountName string
    Database account name.
    accountPassword string
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    accountPrivileges string
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    accountStatus string
    The status of the database account.
    accountType string
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    instanceId string
    The ID of the RDS instance.
    account_name str
    Database account name.
    account_password str
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    account_privileges str
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    account_status str
    The status of the database account.
    account_type str
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    instance_id str
    The ID of the RDS instance.
    accountName String
    Database account name.
    accountPassword String
    The password of the database account. When importing resources, this attribute will not be imported. If this attribute is set, please use lifecycle and ignore_changes ignore changes in fields.
    accountPrivileges String
    The privilege information of account. When the account type is a super account, there is no need to pass in this parameter, and all privileges are supported by default. When the account type is a normal account, this parameter can be passed in, the default values are Login and Inherit.
    accountStatus String
    The status of the database account.
    accountType String
    Database account type, value: Super: A high-privilege account. Only one database account can be created for an instance. Normal: An account with ordinary privileges.
    instanceId String
    The ID of the RDS instance.

    Import

    RDS postgresql account can be imported using the instance_id:account_name, e.g.

     $ pulumi import volcengine:rds_postgresql/account:Account default postgres-ca7b7019****:accountName
    

    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.26 published on Friday, Sep 13, 2024 by Volcengine