1. Packages
  2. DigitalOcean
  3. API Docs
  4. DatabaseUser
DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi

digitalocean.DatabaseUser

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi

    Provides a DigitalOcean database user resource. When creating a new database cluster, a default admin user with name doadmin will be created. Then, this resource can be used to provide additional normal users inside the cluster.

    NOTE: Any new users created will always have normal role, only the default user that comes with database cluster creation has primary role. Additional permissions must be managed manually.

    Example Usage

    Create a new PostgreSQL database user

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
        engine: "pg",
        version: "11",
        size: "db-s-1vcpu-1gb",
        region: "nyc1",
        nodeCount: 1,
    });
    const user_example = new digitalocean.DatabaseUser("user-example", {clusterId: postgres_example.id});
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    postgres_example = digitalocean.DatabaseCluster("postgres-example",
        engine="pg",
        version="11",
        size="db-s-1vcpu-1gb",
        region="nyc1",
        node_count=1)
    user_example = digitalocean.DatabaseUser("user-example", cluster_id=postgres_example.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := digitalocean.NewDatabaseCluster(ctx, "postgres-example", &digitalocean.DatabaseClusterArgs{
    			Engine:    pulumi.String("pg"),
    			Version:   pulumi.String("11"),
    			Size:      pulumi.String("db-s-1vcpu-1gb"),
    			Region:    pulumi.String("nyc1"),
    			NodeCount: pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewDatabaseUser(ctx, "user-example", &digitalocean.DatabaseUserArgs{
    			ClusterId: postgres_example.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new()
        {
            Engine = "pg",
            Version = "11",
            Size = "db-s-1vcpu-1gb",
            Region = "nyc1",
            NodeCount = 1,
        });
    
        var user_example = new DigitalOcean.DatabaseUser("user-example", new()
        {
            ClusterId = postgres_example.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.DatabaseCluster;
    import com.pulumi.digitalocean.DatabaseClusterArgs;
    import com.pulumi.digitalocean.DatabaseUser;
    import com.pulumi.digitalocean.DatabaseUserArgs;
    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 postgres_example = new DatabaseCluster("postgres-example", DatabaseClusterArgs.builder()        
                .engine("pg")
                .version("11")
                .size("db-s-1vcpu-1gb")
                .region("nyc1")
                .nodeCount(1)
                .build());
    
            var user_example = new DatabaseUser("user-example", DatabaseUserArgs.builder()        
                .clusterId(postgres_example.id())
                .build());
    
        }
    }
    
    resources:
      user-example:
        type: digitalocean:DatabaseUser
        properties:
          clusterId: ${["postgres-example"].id}
      postgres-example:
        type: digitalocean:DatabaseCluster
        properties:
          engine: pg
          version: '11'
          size: db-s-1vcpu-1gb
          region: nyc1
          nodeCount: 1
    

    Create a new user for a PostgreSQL database replica

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const postgres_example = new digitalocean.DatabaseCluster("postgres-example", {
        engine: "pg",
        version: "11",
        size: "db-s-1vcpu-1gb",
        region: "nyc1",
        nodeCount: 1,
    });
    const replica_example = new digitalocean.DatabaseReplica("replica-example", {
        clusterId: postgres_example.id,
        size: "db-s-1vcpu-1gb",
        region: "nyc1",
    });
    const user_example = new digitalocean.DatabaseUser("user-example", {clusterId: replica_example.uuid});
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    postgres_example = digitalocean.DatabaseCluster("postgres-example",
        engine="pg",
        version="11",
        size="db-s-1vcpu-1gb",
        region="nyc1",
        node_count=1)
    replica_example = digitalocean.DatabaseReplica("replica-example",
        cluster_id=postgres_example.id,
        size="db-s-1vcpu-1gb",
        region="nyc1")
    user_example = digitalocean.DatabaseUser("user-example", cluster_id=replica_example.uuid)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := digitalocean.NewDatabaseCluster(ctx, "postgres-example", &digitalocean.DatabaseClusterArgs{
    			Engine:    pulumi.String("pg"),
    			Version:   pulumi.String("11"),
    			Size:      pulumi.String("db-s-1vcpu-1gb"),
    			Region:    pulumi.String("nyc1"),
    			NodeCount: pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewDatabaseReplica(ctx, "replica-example", &digitalocean.DatabaseReplicaArgs{
    			ClusterId: postgres_example.ID(),
    			Size:      pulumi.String("db-s-1vcpu-1gb"),
    			Region:    pulumi.String("nyc1"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewDatabaseUser(ctx, "user-example", &digitalocean.DatabaseUserArgs{
    			ClusterId: replica_example.Uuid,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new()
        {
            Engine = "pg",
            Version = "11",
            Size = "db-s-1vcpu-1gb",
            Region = "nyc1",
            NodeCount = 1,
        });
    
        var replica_example = new DigitalOcean.DatabaseReplica("replica-example", new()
        {
            ClusterId = postgres_example.Id,
            Size = "db-s-1vcpu-1gb",
            Region = "nyc1",
        });
    
        var user_example = new DigitalOcean.DatabaseUser("user-example", new()
        {
            ClusterId = replica_example.Uuid,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.DatabaseCluster;
    import com.pulumi.digitalocean.DatabaseClusterArgs;
    import com.pulumi.digitalocean.DatabaseReplica;
    import com.pulumi.digitalocean.DatabaseReplicaArgs;
    import com.pulumi.digitalocean.DatabaseUser;
    import com.pulumi.digitalocean.DatabaseUserArgs;
    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 postgres_example = new DatabaseCluster("postgres-example", DatabaseClusterArgs.builder()        
                .engine("pg")
                .version("11")
                .size("db-s-1vcpu-1gb")
                .region("nyc1")
                .nodeCount(1)
                .build());
    
            var replica_example = new DatabaseReplica("replica-example", DatabaseReplicaArgs.builder()        
                .clusterId(postgres_example.id())
                .size("db-s-1vcpu-1gb")
                .region("nyc1")
                .build());
    
            var user_example = new DatabaseUser("user-example", DatabaseUserArgs.builder()        
                .clusterId(replica_example.uuid())
                .build());
    
        }
    }
    
    resources:
      postgres-example:
        type: digitalocean:DatabaseCluster
        properties:
          engine: pg
          version: '11'
          size: db-s-1vcpu-1gb
          region: nyc1
          nodeCount: 1
      replica-example:
        type: digitalocean:DatabaseReplica
        properties:
          clusterId: ${["postgres-example"].id}
          size: db-s-1vcpu-1gb
          region: nyc1
      user-example:
        type: digitalocean:DatabaseUser
        properties:
          clusterId: ${["replica-example"].uuid}
    

    Create a new user for a Kafka database cluster

    import * as pulumi from "@pulumi/pulumi";
    import * as digitalocean from "@pulumi/digitalocean";
    
    const kafka_example = new digitalocean.DatabaseCluster("kafka-example", {
        engine: "kafka",
        version: "3.5",
        size: "db-s-2vcpu-2gb",
        region: "nyc1",
        nodeCount: 3,
    });
    const foobarTopic = new digitalocean.DatabaseKafkaTopic("foobarTopic", {clusterId: digitalocean_database_cluster.foobar.id});
    const foobarUser = new digitalocean.DatabaseUser("foobarUser", {
        clusterId: digitalocean_database_cluster.foobar.id,
        settings: [{
            acls: [
                {
                    topic: "topic-1",
                    permission: "produce",
                },
                {
                    topic: "topic-2",
                    permission: "produceconsume",
                },
                {
                    topic: "topic-*",
                    permission: "consume",
                },
            ],
        }],
    });
    
    import pulumi
    import pulumi_digitalocean as digitalocean
    
    kafka_example = digitalocean.DatabaseCluster("kafka-example",
        engine="kafka",
        version="3.5",
        size="db-s-2vcpu-2gb",
        region="nyc1",
        node_count=3)
    foobar_topic = digitalocean.DatabaseKafkaTopic("foobarTopic", cluster_id=digitalocean_database_cluster["foobar"]["id"])
    foobar_user = digitalocean.DatabaseUser("foobarUser",
        cluster_id=digitalocean_database_cluster["foobar"]["id"],
        settings=[digitalocean.DatabaseUserSettingArgs(
            acls=[
                digitalocean.DatabaseUserSettingAclArgs(
                    topic="topic-1",
                    permission="produce",
                ),
                digitalocean.DatabaseUserSettingAclArgs(
                    topic="topic-2",
                    permission="produceconsume",
                ),
                digitalocean.DatabaseUserSettingAclArgs(
                    topic="topic-*",
                    permission="consume",
                ),
            ],
        )])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-digitalocean/sdk/v4/go/digitalocean"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := digitalocean.NewDatabaseCluster(ctx, "kafka-example", &digitalocean.DatabaseClusterArgs{
    			Engine:    pulumi.String("kafka"),
    			Version:   pulumi.String("3.5"),
    			Size:      pulumi.String("db-s-2vcpu-2gb"),
    			Region:    pulumi.String("nyc1"),
    			NodeCount: pulumi.Int(3),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewDatabaseKafkaTopic(ctx, "foobarTopic", &digitalocean.DatabaseKafkaTopicArgs{
    			ClusterId: pulumi.Any(digitalocean_database_cluster.Foobar.Id),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = digitalocean.NewDatabaseUser(ctx, "foobarUser", &digitalocean.DatabaseUserArgs{
    			ClusterId: pulumi.Any(digitalocean_database_cluster.Foobar.Id),
    			Settings: digitalocean.DatabaseUserSettingArray{
    				&digitalocean.DatabaseUserSettingArgs{
    					Acls: digitalocean.DatabaseUserSettingAclArray{
    						&digitalocean.DatabaseUserSettingAclArgs{
    							Topic:      pulumi.String("topic-1"),
    							Permission: pulumi.String("produce"),
    						},
    						&digitalocean.DatabaseUserSettingAclArgs{
    							Topic:      pulumi.String("topic-2"),
    							Permission: pulumi.String("produceconsume"),
    						},
    						&digitalocean.DatabaseUserSettingAclArgs{
    							Topic:      pulumi.String("topic-*"),
    							Permission: pulumi.String("consume"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using DigitalOcean = Pulumi.DigitalOcean;
    
    return await Deployment.RunAsync(() => 
    {
        var kafka_example = new DigitalOcean.DatabaseCluster("kafka-example", new()
        {
            Engine = "kafka",
            Version = "3.5",
            Size = "db-s-2vcpu-2gb",
            Region = "nyc1",
            NodeCount = 3,
        });
    
        var foobarTopic = new DigitalOcean.DatabaseKafkaTopic("foobarTopic", new()
        {
            ClusterId = digitalocean_database_cluster.Foobar.Id,
        });
    
        var foobarUser = new DigitalOcean.DatabaseUser("foobarUser", new()
        {
            ClusterId = digitalocean_database_cluster.Foobar.Id,
            Settings = new[]
            {
                new DigitalOcean.Inputs.DatabaseUserSettingArgs
                {
                    Acls = new[]
                    {
                        new DigitalOcean.Inputs.DatabaseUserSettingAclArgs
                        {
                            Topic = "topic-1",
                            Permission = "produce",
                        },
                        new DigitalOcean.Inputs.DatabaseUserSettingAclArgs
                        {
                            Topic = "topic-2",
                            Permission = "produceconsume",
                        },
                        new DigitalOcean.Inputs.DatabaseUserSettingAclArgs
                        {
                            Topic = "topic-*",
                            Permission = "consume",
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.digitalocean.DatabaseCluster;
    import com.pulumi.digitalocean.DatabaseClusterArgs;
    import com.pulumi.digitalocean.DatabaseKafkaTopic;
    import com.pulumi.digitalocean.DatabaseKafkaTopicArgs;
    import com.pulumi.digitalocean.DatabaseUser;
    import com.pulumi.digitalocean.DatabaseUserArgs;
    import com.pulumi.digitalocean.inputs.DatabaseUserSettingArgs;
    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 kafka_example = new DatabaseCluster("kafka-example", DatabaseClusterArgs.builder()        
                .engine("kafka")
                .version("3.5")
                .size("db-s-2vcpu-2gb")
                .region("nyc1")
                .nodeCount(3)
                .build());
    
            var foobarTopic = new DatabaseKafkaTopic("foobarTopic", DatabaseKafkaTopicArgs.builder()        
                .clusterId(digitalocean_database_cluster.foobar().id())
                .build());
    
            var foobarUser = new DatabaseUser("foobarUser", DatabaseUserArgs.builder()        
                .clusterId(digitalocean_database_cluster.foobar().id())
                .settings(DatabaseUserSettingArgs.builder()
                    .acls(                
                        DatabaseUserSettingAclArgs.builder()
                            .topic("topic-1")
                            .permission("produce")
                            .build(),
                        DatabaseUserSettingAclArgs.builder()
                            .topic("topic-2")
                            .permission("produceconsume")
                            .build(),
                        DatabaseUserSettingAclArgs.builder()
                            .topic("topic-*")
                            .permission("consume")
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      kafka-example:
        type: digitalocean:DatabaseCluster
        properties:
          engine: kafka
          version: '3.5'
          size: db-s-2vcpu-2gb
          region: nyc1
          nodeCount: 3
      foobarTopic:
        type: digitalocean:DatabaseKafkaTopic
        properties:
          clusterId: ${digitalocean_database_cluster.foobar.id}
      foobarUser:
        type: digitalocean:DatabaseUser
        properties:
          clusterId: ${digitalocean_database_cluster.foobar.id}
          settings:
            - acls:
                - topic: topic-1
                  permission: produce
                - topic: topic-2
                  permission: produceconsume
                - topic: topic-*
                  permission: consume
    

    Create DatabaseUser Resource

    new DatabaseUser(name: string, args: DatabaseUserArgs, opts?: CustomResourceOptions);
    @overload
    def DatabaseUser(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     cluster_id: Optional[str] = None,
                     mysql_auth_plugin: Optional[str] = None,
                     name: Optional[str] = None,
                     settings: Optional[Sequence[DatabaseUserSettingArgs]] = None)
    @overload
    def DatabaseUser(resource_name: str,
                     args: DatabaseUserArgs,
                     opts: Optional[ResourceOptions] = None)
    func NewDatabaseUser(ctx *Context, name string, args DatabaseUserArgs, opts ...ResourceOption) (*DatabaseUser, error)
    public DatabaseUser(string name, DatabaseUserArgs args, CustomResourceOptions? opts = null)
    public DatabaseUser(String name, DatabaseUserArgs args)
    public DatabaseUser(String name, DatabaseUserArgs args, CustomResourceOptions options)
    
    type: digitalocean:DatabaseUser
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args DatabaseUserArgs
    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 DatabaseUserArgs
    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 DatabaseUserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DatabaseUserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DatabaseUserArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    DatabaseUser 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 DatabaseUser resource accepts the following input properties:

    ClusterId string
    The ID of the original source database cluster.
    MysqlAuthPlugin string
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    Name string
    The name for the database user.
    Settings List<Pulumi.DigitalOcean.Inputs.DatabaseUserSetting>
    Contains optional settings for the user. The settings block is documented below.
    ClusterId string
    The ID of the original source database cluster.
    MysqlAuthPlugin string
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    Name string
    The name for the database user.
    Settings []DatabaseUserSettingArgs
    Contains optional settings for the user. The settings block is documented below.
    clusterId String
    The ID of the original source database cluster.
    mysqlAuthPlugin String
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    name String
    The name for the database user.
    settings List<DatabaseUserSetting>
    Contains optional settings for the user. The settings block is documented below.
    clusterId string
    The ID of the original source database cluster.
    mysqlAuthPlugin string
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    name string
    The name for the database user.
    settings DatabaseUserSetting[]
    Contains optional settings for the user. The settings block is documented below.
    cluster_id str
    The ID of the original source database cluster.
    mysql_auth_plugin str
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    name str
    The name for the database user.
    settings Sequence[DatabaseUserSettingArgs]
    Contains optional settings for the user. The settings block is documented below.
    clusterId String
    The ID of the original source database cluster.
    mysqlAuthPlugin String
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    name String
    The name for the database user.
    settings List<Property Map>
    Contains optional settings for the user. The settings block is documented below.

    Outputs

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

    AccessCert string
    Access certificate for TLS client authentication. (Kafka only)
    AccessKey string
    Access key for TLS client authentication. (Kafka only)
    Id string
    The provider-assigned unique ID for this managed resource.
    Password string
    Password for the database user.
    Role string
    Role for the database user. The value will be either "primary" or "normal".
    AccessCert string
    Access certificate for TLS client authentication. (Kafka only)
    AccessKey string
    Access key for TLS client authentication. (Kafka only)
    Id string
    The provider-assigned unique ID for this managed resource.
    Password string
    Password for the database user.
    Role string
    Role for the database user. The value will be either "primary" or "normal".
    accessCert String
    Access certificate for TLS client authentication. (Kafka only)
    accessKey String
    Access key for TLS client authentication. (Kafka only)
    id String
    The provider-assigned unique ID for this managed resource.
    password String
    Password for the database user.
    role String
    Role for the database user. The value will be either "primary" or "normal".
    accessCert string
    Access certificate for TLS client authentication. (Kafka only)
    accessKey string
    Access key for TLS client authentication. (Kafka only)
    id string
    The provider-assigned unique ID for this managed resource.
    password string
    Password for the database user.
    role string
    Role for the database user. The value will be either "primary" or "normal".
    access_cert str
    Access certificate for TLS client authentication. (Kafka only)
    access_key str
    Access key for TLS client authentication. (Kafka only)
    id str
    The provider-assigned unique ID for this managed resource.
    password str
    Password for the database user.
    role str
    Role for the database user. The value will be either "primary" or "normal".
    accessCert String
    Access certificate for TLS client authentication. (Kafka only)
    accessKey String
    Access key for TLS client authentication. (Kafka only)
    id String
    The provider-assigned unique ID for this managed resource.
    password String
    Password for the database user.
    role String
    Role for the database user. The value will be either "primary" or "normal".

    Look up Existing DatabaseUser Resource

    Get an existing DatabaseUser 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?: DatabaseUserState, opts?: CustomResourceOptions): DatabaseUser
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_cert: Optional[str] = None,
            access_key: Optional[str] = None,
            cluster_id: Optional[str] = None,
            mysql_auth_plugin: Optional[str] = None,
            name: Optional[str] = None,
            password: Optional[str] = None,
            role: Optional[str] = None,
            settings: Optional[Sequence[DatabaseUserSettingArgs]] = None) -> DatabaseUser
    func GetDatabaseUser(ctx *Context, name string, id IDInput, state *DatabaseUserState, opts ...ResourceOption) (*DatabaseUser, error)
    public static DatabaseUser Get(string name, Input<string> id, DatabaseUserState? state, CustomResourceOptions? opts = null)
    public static DatabaseUser get(String name, Output<String> id, DatabaseUserState 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:
    AccessCert string
    Access certificate for TLS client authentication. (Kafka only)
    AccessKey string
    Access key for TLS client authentication. (Kafka only)
    ClusterId string
    The ID of the original source database cluster.
    MysqlAuthPlugin string
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    Name string
    The name for the database user.
    Password string
    Password for the database user.
    Role string
    Role for the database user. The value will be either "primary" or "normal".
    Settings List<Pulumi.DigitalOcean.Inputs.DatabaseUserSetting>
    Contains optional settings for the user. The settings block is documented below.
    AccessCert string
    Access certificate for TLS client authentication. (Kafka only)
    AccessKey string
    Access key for TLS client authentication. (Kafka only)
    ClusterId string
    The ID of the original source database cluster.
    MysqlAuthPlugin string
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    Name string
    The name for the database user.
    Password string
    Password for the database user.
    Role string
    Role for the database user. The value will be either "primary" or "normal".
    Settings []DatabaseUserSettingArgs
    Contains optional settings for the user. The settings block is documented below.
    accessCert String
    Access certificate for TLS client authentication. (Kafka only)
    accessKey String
    Access key for TLS client authentication. (Kafka only)
    clusterId String
    The ID of the original source database cluster.
    mysqlAuthPlugin String
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    name String
    The name for the database user.
    password String
    Password for the database user.
    role String
    Role for the database user. The value will be either "primary" or "normal".
    settings List<DatabaseUserSetting>
    Contains optional settings for the user. The settings block is documented below.
    accessCert string
    Access certificate for TLS client authentication. (Kafka only)
    accessKey string
    Access key for TLS client authentication. (Kafka only)
    clusterId string
    The ID of the original source database cluster.
    mysqlAuthPlugin string
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    name string
    The name for the database user.
    password string
    Password for the database user.
    role string
    Role for the database user. The value will be either "primary" or "normal".
    settings DatabaseUserSetting[]
    Contains optional settings for the user. The settings block is documented below.
    access_cert str
    Access certificate for TLS client authentication. (Kafka only)
    access_key str
    Access key for TLS client authentication. (Kafka only)
    cluster_id str
    The ID of the original source database cluster.
    mysql_auth_plugin str
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    name str
    The name for the database user.
    password str
    Password for the database user.
    role str
    Role for the database user. The value will be either "primary" or "normal".
    settings Sequence[DatabaseUserSettingArgs]
    Contains optional settings for the user. The settings block is documented below.
    accessCert String
    Access certificate for TLS client authentication. (Kafka only)
    accessKey String
    Access key for TLS client authentication. (Kafka only)
    clusterId String
    The ID of the original source database cluster.
    mysqlAuthPlugin String
    The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).
    name String
    The name for the database user.
    password String
    Password for the database user.
    role String
    Role for the database user. The value will be either "primary" or "normal".
    settings List<Property Map>
    Contains optional settings for the user. The settings block is documented below.

    Supporting Types

    DatabaseUserSetting, DatabaseUserSettingArgs

    Acls List<Pulumi.DigitalOcean.Inputs.DatabaseUserSettingAcl>

    A set of ACLs (Access Control Lists) specifying permission on topics with a Kafka cluster. The properties of an individual ACL are described below:

    An individual ACL includes the following:

    Acls []DatabaseUserSettingAcl

    A set of ACLs (Access Control Lists) specifying permission on topics with a Kafka cluster. The properties of an individual ACL are described below:

    An individual ACL includes the following:

    acls List<DatabaseUserSettingAcl>

    A set of ACLs (Access Control Lists) specifying permission on topics with a Kafka cluster. The properties of an individual ACL are described below:

    An individual ACL includes the following:

    acls DatabaseUserSettingAcl[]

    A set of ACLs (Access Control Lists) specifying permission on topics with a Kafka cluster. The properties of an individual ACL are described below:

    An individual ACL includes the following:

    acls Sequence[DatabaseUserSettingAcl]

    A set of ACLs (Access Control Lists) specifying permission on topics with a Kafka cluster. The properties of an individual ACL are described below:

    An individual ACL includes the following:

    acls List<Property Map>

    A set of ACLs (Access Control Lists) specifying permission on topics with a Kafka cluster. The properties of an individual ACL are described below:

    An individual ACL includes the following:

    DatabaseUserSettingAcl, DatabaseUserSettingAclArgs

    Permission string
    The permission level applied to the ACL. This includes "admin", "consume", "produce", and "produceconsume". "admin" allows for producing and consuming as well as add/delete/update permission for topics. "consume" allows only for reading topic messages. "produce" allows only for writing topic messages. "produceconsume" allows for both reading and writing topic messages.
    Topic string
    A regex for matching the topic(s) that this ACL should apply to. The regex can assume one of 3 patterns: "", "", or "". "" is a special value indicating a wildcard that matches on all topics. "" defines a regex that matches all topics with the prefix. "" performs an exact match on a topic name and only applies to that topic.
    Id string
    An identifier for the ACL, this will be automatically assigned when you create an ACL entry
    Permission string
    The permission level applied to the ACL. This includes "admin", "consume", "produce", and "produceconsume". "admin" allows for producing and consuming as well as add/delete/update permission for topics. "consume" allows only for reading topic messages. "produce" allows only for writing topic messages. "produceconsume" allows for both reading and writing topic messages.
    Topic string
    A regex for matching the topic(s) that this ACL should apply to. The regex can assume one of 3 patterns: "", "", or "". "" is a special value indicating a wildcard that matches on all topics. "" defines a regex that matches all topics with the prefix. "" performs an exact match on a topic name and only applies to that topic.
    Id string
    An identifier for the ACL, this will be automatically assigned when you create an ACL entry
    permission String
    The permission level applied to the ACL. This includes "admin", "consume", "produce", and "produceconsume". "admin" allows for producing and consuming as well as add/delete/update permission for topics. "consume" allows only for reading topic messages. "produce" allows only for writing topic messages. "produceconsume" allows for both reading and writing topic messages.
    topic String
    A regex for matching the topic(s) that this ACL should apply to. The regex can assume one of 3 patterns: "", "", or "". "" is a special value indicating a wildcard that matches on all topics. "" defines a regex that matches all topics with the prefix. "" performs an exact match on a topic name and only applies to that topic.
    id String
    An identifier for the ACL, this will be automatically assigned when you create an ACL entry
    permission string
    The permission level applied to the ACL. This includes "admin", "consume", "produce", and "produceconsume". "admin" allows for producing and consuming as well as add/delete/update permission for topics. "consume" allows only for reading topic messages. "produce" allows only for writing topic messages. "produceconsume" allows for both reading and writing topic messages.
    topic string
    A regex for matching the topic(s) that this ACL should apply to. The regex can assume one of 3 patterns: "", "", or "". "" is a special value indicating a wildcard that matches on all topics. "" defines a regex that matches all topics with the prefix. "" performs an exact match on a topic name and only applies to that topic.
    id string
    An identifier for the ACL, this will be automatically assigned when you create an ACL entry
    permission str
    The permission level applied to the ACL. This includes "admin", "consume", "produce", and "produceconsume". "admin" allows for producing and consuming as well as add/delete/update permission for topics. "consume" allows only for reading topic messages. "produce" allows only for writing topic messages. "produceconsume" allows for both reading and writing topic messages.
    topic str
    A regex for matching the topic(s) that this ACL should apply to. The regex can assume one of 3 patterns: "", "", or "". "" is a special value indicating a wildcard that matches on all topics. "" defines a regex that matches all topics with the prefix. "" performs an exact match on a topic name and only applies to that topic.
    id str
    An identifier for the ACL, this will be automatically assigned when you create an ACL entry
    permission String
    The permission level applied to the ACL. This includes "admin", "consume", "produce", and "produceconsume". "admin" allows for producing and consuming as well as add/delete/update permission for topics. "consume" allows only for reading topic messages. "produce" allows only for writing topic messages. "produceconsume" allows for both reading and writing topic messages.
    topic String
    A regex for matching the topic(s) that this ACL should apply to. The regex can assume one of 3 patterns: "", "", or "". "" is a special value indicating a wildcard that matches on all topics. "" defines a regex that matches all topics with the prefix. "" performs an exact match on a topic name and only applies to that topic.
    id String
    An identifier for the ACL, this will be automatically assigned when you create an ACL entry

    Import

    Database user can be imported using the id of the source database cluster

    and the name of the user joined with a comma. For example:

    $ pulumi import digitalocean:index/databaseUser:DatabaseUser user-example 245bcfd0-7f31-4ce6-a2bc-475a116cca97,foobar
    

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.27.0 published on Wednesday, Mar 13, 2024 by Pulumi