DatabaseConnectionPool
Provides a DigitalOcean database connection pool resource.
Example Usage
Create a new PostgreSQL database connection pool
using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;
class MyStack : Stack
{
public MyStack()
{
var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
{
Engine = "pg",
Version = "11",
Size = "db-s-1vcpu-1gb",
Region = "nyc1",
NodeCount = 1,
});
var pool_01 = new DigitalOcean.DatabaseConnectionPool("pool-01", new DigitalOcean.DatabaseConnectionPoolArgs
{
ClusterId = postgres_example.Id,
Mode = "transaction",
Size = 20,
DbName = "defaultdb",
User = "doadmin",
});
}
}
Coming soon!
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)
pool_01 = digitalocean.DatabaseConnectionPool("pool-01",
cluster_id=postgres_example.id,
mode="transaction",
size=20,
db_name="defaultdb",
user="doadmin")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 pool_01 = new digitalocean.DatabaseConnectionPool("pool-01", {
clusterId: postgres_example.id,
mode: "transaction",
size: 20,
dbName: "defaultdb",
user: "doadmin",
});Create a DatabaseConnectionPool Resource
new DatabaseConnectionPool(name: string, args: DatabaseConnectionPoolArgs, opts?: CustomResourceOptions);def DatabaseConnectionPool(resource_name, opts=None, cluster_id=None, db_name=None, mode=None, name=None, size=None, user=None, __props__=None);func NewDatabaseConnectionPool(ctx *Context, name string, args DatabaseConnectionPoolArgs, opts ...ResourceOption) (*DatabaseConnectionPool, error)public DatabaseConnectionPool(string name, DatabaseConnectionPoolArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DatabaseConnectionPoolArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DatabaseConnectionPoolArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseConnectionPoolArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DatabaseConnectionPool Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DatabaseConnectionPool resource accepts the following input properties:
- Cluster
Id string The ID of the source database cluster. Note: This must be a PostgreSQL cluster.
- Db
Name string The database for use with the connection pool.
- Mode string
The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
- Size int
The desired size of the PGBouncer connection pool.
- User string
The name of the database user for use with the connection pool.
- Name string
The name for the database connection pool.
- Cluster
Id string The ID of the source database cluster. Note: This must be a PostgreSQL cluster.
- Db
Name string The database for use with the connection pool.
- Mode string
The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
- Size int
The desired size of the PGBouncer connection pool.
- User string
The name of the database user for use with the connection pool.
- Name string
The name for the database connection pool.
- cluster
Id string The ID of the source database cluster. Note: This must be a PostgreSQL cluster.
- db
Name string The database for use with the connection pool.
- mode string
The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
- size number
The desired size of the PGBouncer connection pool.
- user string
The name of the database user for use with the connection pool.
- name string
The name for the database connection pool.
- cluster_
id str The ID of the source database cluster. Note: This must be a PostgreSQL cluster.
- db_
name str The database for use with the connection pool.
- mode str
The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
- size float
The desired size of the PGBouncer connection pool.
- user str
The name of the database user for use with the connection pool.
- name str
The name for the database connection pool.
Outputs
All input properties are implicitly available as output properties. Additionally, the DatabaseConnectionPool resource produces the following output properties:
- Host string
The hostname used to connect to the database connection pool.
- Id string
- The provider-assigned unique ID for this managed resource.
- Password string
Password for the connection pool’s user.
- Port int
Network port that the database connection pool is listening on.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Uri string Same as
uri, but only accessible from resources within the account and in the same region.- Uri string
The full URI for connecting to the database connection pool.
- Host string
The hostname used to connect to the database connection pool.
- Id string
- The provider-assigned unique ID for this managed resource.
- Password string
Password for the connection pool’s user.
- Port int
Network port that the database connection pool is listening on.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Uri string Same as
uri, but only accessible from resources within the account and in the same region.- Uri string
The full URI for connecting to the database connection pool.
- host string
The hostname used to connect to the database connection pool.
- id string
- The provider-assigned unique ID for this managed resource.
- password string
Password for the connection pool’s user.
- port number
Network port that the database connection pool is listening on.
- private
Host string Same as
host, but only accessible from resources within the account and in the same region.- private
Uri string Same as
uri, but only accessible from resources within the account and in the same region.- uri string
The full URI for connecting to the database connection pool.
- host str
The hostname used to connect to the database connection pool.
- id str
- The provider-assigned unique ID for this managed resource.
- password str
Password for the connection pool’s user.
- port float
Network port that the database connection pool is listening on.
- private_
host str Same as
host, but only accessible from resources within the account and in the same region.- private_
uri str Same as
uri, but only accessible from resources within the account and in the same region.- uri str
The full URI for connecting to the database connection pool.
Look up an Existing DatabaseConnectionPool Resource
Get an existing DatabaseConnectionPool 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?: DatabaseConnectionPoolState, opts?: CustomResourceOptions): DatabaseConnectionPoolstatic get(resource_name, id, opts=None, cluster_id=None, db_name=None, host=None, mode=None, name=None, password=None, port=None, private_host=None, private_uri=None, size=None, uri=None, user=None, __props__=None);func GetDatabaseConnectionPool(ctx *Context, name string, id IDInput, state *DatabaseConnectionPoolState, opts ...ResourceOption) (*DatabaseConnectionPool, error)public static DatabaseConnectionPool Get(string name, Input<string> id, DatabaseConnectionPoolState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Cluster
Id string The ID of the source database cluster. Note: This must be a PostgreSQL cluster.
- Db
Name string The database for use with the connection pool.
- Host string
The hostname used to connect to the database connection pool.
- Mode string
The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
- Name string
The name for the database connection pool.
- Password string
Password for the connection pool’s user.
- Port int
Network port that the database connection pool is listening on.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Uri string Same as
uri, but only accessible from resources within the account and in the same region.- Size int
The desired size of the PGBouncer connection pool.
- Uri string
The full URI for connecting to the database connection pool.
- User string
The name of the database user for use with the connection pool.
- Cluster
Id string The ID of the source database cluster. Note: This must be a PostgreSQL cluster.
- Db
Name string The database for use with the connection pool.
- Host string
The hostname used to connect to the database connection pool.
- Mode string
The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
- Name string
The name for the database connection pool.
- Password string
Password for the connection pool’s user.
- Port int
Network port that the database connection pool is listening on.
- Private
Host string Same as
host, but only accessible from resources within the account and in the same region.- Private
Uri string Same as
uri, but only accessible from resources within the account and in the same region.- Size int
The desired size of the PGBouncer connection pool.
- Uri string
The full URI for connecting to the database connection pool.
- User string
The name of the database user for use with the connection pool.
- cluster
Id string The ID of the source database cluster. Note: This must be a PostgreSQL cluster.
- db
Name string The database for use with the connection pool.
- host string
The hostname used to connect to the database connection pool.
- mode string
The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
- name string
The name for the database connection pool.
- password string
Password for the connection pool’s user.
- port number
Network port that the database connection pool is listening on.
- private
Host string Same as
host, but only accessible from resources within the account and in the same region.- private
Uri string Same as
uri, but only accessible from resources within the account and in the same region.- size number
The desired size of the PGBouncer connection pool.
- uri string
The full URI for connecting to the database connection pool.
- user string
The name of the database user for use with the connection pool.
- cluster_
id str The ID of the source database cluster. Note: This must be a PostgreSQL cluster.
- db_
name str The database for use with the connection pool.
- host str
The hostname used to connect to the database connection pool.
- mode str
The PGBouncer transaction mode for the connection pool. The allowed values are session, transaction, and statement.
- name str
The name for the database connection pool.
- password str
Password for the connection pool’s user.
- port float
Network port that the database connection pool is listening on.
- private_
host str Same as
host, but only accessible from resources within the account and in the same region.- private_
uri str Same as
uri, but only accessible from resources within the account and in the same region.- size float
The desired size of the PGBouncer connection pool.
- uri str
The full URI for connecting to the database connection pool.
- user str
The name of the database user for use with the connection pool.
Package Details
- Repository
- https://github.com/pulumi/pulumi-digitalocean
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
digitaloceanTerraform Provider.