ConnectionPool
# Connection Pool Resource
The Connection Pool resource allows the creation and management of Aiven Connection Pools.
Example Usage
using Pulumi;
using Aiven = Pulumi.Aiven;
class MyStack : Stack
{
public MyStack()
{
var mytestpool = new Aiven.ConnectionPool("mytestpool", new Aiven.ConnectionPoolArgs
{
DatabaseName = aiven_database.Mydatabase.Database_name,
PoolMode = "transaction",
PoolName = "mypool",
PoolSize = 10,
Project = aiven_project.Myproject.Project,
ServiceName = aiven_service.Myservice.Service_name,
Username = aiven_service_user.Myserviceuser.Username,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aiven/sdk/v3/go/aiven"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := aiven.NewConnectionPool(ctx, "mytestpool", &aiven.ConnectionPoolArgs{
DatabaseName: pulumi.Any(aiven_database.Mydatabase.Database_name),
PoolMode: pulumi.String("transaction"),
PoolName: pulumi.String("mypool"),
PoolSize: pulumi.Int(10),
Project: pulumi.Any(aiven_project.Myproject.Project),
ServiceName: pulumi.Any(aiven_service.Myservice.Service_name),
Username: pulumi.Any(aiven_service_user.Myserviceuser.Username),
})
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_aiven as aiven
mytestpool = aiven.ConnectionPool("mytestpool",
database_name=aiven_database["mydatabase"]["database_name"],
pool_mode="transaction",
pool_name="mypool",
pool_size=10,
project=aiven_project["myproject"]["project"],
service_name=aiven_service["myservice"]["service_name"],
username=aiven_service_user["myserviceuser"]["username"])
import * as pulumi from "@pulumi/pulumi";
import * as aiven from "@pulumi/aiven";
const mytestpool = new aiven.ConnectionPool("mytestpool", {
databaseName: aiven_database_mydatabase.databaseName,
poolMode: "transaction",
poolName: "mypool",
poolSize: 10,
project: aiven_project_myproject.project,
serviceName: aiven_service_myservice.serviceName,
username: aiven_service_user_myserviceuser.username,
});
Create a ConnectionPool Resource
new ConnectionPool(name: string, args: ConnectionPoolArgs, opts?: CustomResourceOptions);
def ConnectionPool(resource_name: str, opts: Optional[ResourceOptions] = None, database_name: Optional[str] = None, pool_mode: Optional[str] = None, pool_name: Optional[str] = None, pool_size: Optional[int] = None, project: Optional[str] = None, service_name: Optional[str] = None, username: Optional[str] = None)
func NewConnectionPool(ctx *Context, name string, args ConnectionPoolArgs, opts ...ResourceOption) (*ConnectionPool, error)
public ConnectionPool(string name, ConnectionPoolArgs args, CustomResourceOptions? opts = null)
- name string
- The unique name of the resource.
- args ConnectionPoolArgs
- 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 ConnectionPoolArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ConnectionPoolArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ConnectionPool Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ConnectionPool resource accepts the following input properties:
- Database
Name string is the name of the database the pool connects to. This should be defined using reference as shown above to set up dependencies correctly.
- Pool
Name string is the name of the pool.
- Project string
and
service_name
- (Required) define the project and service the connection pool belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the connection pool being deleted and new one created instead.- Service
Name string Service to link the connection pool to
- Username string
is the name of the service user used to connect to the database. This should be defined using reference as shown above to set up dependencies correctly.
- Pool
Mode string is the mode the pool operates in (session, transaction, statement).
- Pool
Size int is the number of connections the pool may create towards the backend server. This does not affect the number of incoming connections, which is always a much larger number.
- Database
Name string is the name of the database the pool connects to. This should be defined using reference as shown above to set up dependencies correctly.
- Pool
Name string is the name of the pool.
- Project string
and
service_name
- (Required) define the project and service the connection pool belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the connection pool being deleted and new one created instead.- Service
Name string Service to link the connection pool to
- Username string
is the name of the service user used to connect to the database. This should be defined using reference as shown above to set up dependencies correctly.
- Pool
Mode string is the mode the pool operates in (session, transaction, statement).
- Pool
Size int is the number of connections the pool may create towards the backend server. This does not affect the number of incoming connections, which is always a much larger number.
- database
Name string is the name of the database the pool connects to. This should be defined using reference as shown above to set up dependencies correctly.
- pool
Name string is the name of the pool.
- project string
and
service_name
- (Required) define the project and service the connection pool belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the connection pool being deleted and new one created instead.- service
Name string Service to link the connection pool to
- username string
is the name of the service user used to connect to the database. This should be defined using reference as shown above to set up dependencies correctly.
- pool
Mode string is the mode the pool operates in (session, transaction, statement).
- pool
Size number is the number of connections the pool may create towards the backend server. This does not affect the number of incoming connections, which is always a much larger number.
- database_
name str is the name of the database the pool connects to. This should be defined using reference as shown above to set up dependencies correctly.
- pool_
name str is the name of the pool.
- project str
and
service_name
- (Required) define the project and service the connection pool belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the connection pool being deleted and new one created instead.- service_
name str Service to link the connection pool to
- username str
is the name of the service user used to connect to the database. This should be defined using reference as shown above to set up dependencies correctly.
- pool_
mode str is the mode the pool operates in (session, transaction, statement).
- pool_
size int is the number of connections the pool may create towards the backend server. This does not affect the number of incoming connections, which is always a much larger number.
Outputs
All input properties are implicitly available as output properties. Additionally, the ConnectionPool resource produces the following output properties:
- Connection
Uri string (Optional) is a computed property that tells the URI for connecting to the pool. This value cannot be set, only read.
- Id string
- The provider-assigned unique ID for this managed resource.
- Connection
Uri string (Optional) is a computed property that tells the URI for connecting to the pool. This value cannot be set, only read.
- Id string
- The provider-assigned unique ID for this managed resource.
- connection
Uri string (Optional) is a computed property that tells the URI for connecting to the pool. This value cannot be set, only read.
- id string
- The provider-assigned unique ID for this managed resource.
- connection_
uri str (Optional) is a computed property that tells the URI for connecting to the pool. This value cannot be set, only read.
- id str
- The provider-assigned unique ID for this managed resource.
Look up an Existing ConnectionPool Resource
Get an existing ConnectionPool 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?: ConnectionPoolState, opts?: CustomResourceOptions): ConnectionPool
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, connection_uri: Optional[str] = None, database_name: Optional[str] = None, pool_mode: Optional[str] = None, pool_name: Optional[str] = None, pool_size: Optional[int] = None, project: Optional[str] = None, service_name: Optional[str] = None, username: Optional[str] = None) -> ConnectionPool
func GetConnectionPool(ctx *Context, name string, id IDInput, state *ConnectionPoolState, opts ...ResourceOption) (*ConnectionPool, error)
public static ConnectionPool Get(string name, Input<string> id, ConnectionPoolState? 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:
- Connection
Uri string (Optional) is a computed property that tells the URI for connecting to the pool. This value cannot be set, only read.
- Database
Name string is the name of the database the pool connects to. This should be defined using reference as shown above to set up dependencies correctly.
- Pool
Mode string is the mode the pool operates in (session, transaction, statement).
- Pool
Name string is the name of the pool.
- Pool
Size int is the number of connections the pool may create towards the backend server. This does not affect the number of incoming connections, which is always a much larger number.
- Project string
and
service_name
- (Required) define the project and service the connection pool belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the connection pool being deleted and new one created instead.- Service
Name string Service to link the connection pool to
- Username string
is the name of the service user used to connect to the database. This should be defined using reference as shown above to set up dependencies correctly.
- Connection
Uri string (Optional) is a computed property that tells the URI for connecting to the pool. This value cannot be set, only read.
- Database
Name string is the name of the database the pool connects to. This should be defined using reference as shown above to set up dependencies correctly.
- Pool
Mode string is the mode the pool operates in (session, transaction, statement).
- Pool
Name string is the name of the pool.
- Pool
Size int is the number of connections the pool may create towards the backend server. This does not affect the number of incoming connections, which is always a much larger number.
- Project string
and
service_name
- (Required) define the project and service the connection pool belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the connection pool being deleted and new one created instead.- Service
Name string Service to link the connection pool to
- Username string
is the name of the service user used to connect to the database. This should be defined using reference as shown above to set up dependencies correctly.
- connection
Uri string (Optional) is a computed property that tells the URI for connecting to the pool. This value cannot be set, only read.
- database
Name string is the name of the database the pool connects to. This should be defined using reference as shown above to set up dependencies correctly.
- pool
Mode string is the mode the pool operates in (session, transaction, statement).
- pool
Name string is the name of the pool.
- pool
Size number is the number of connections the pool may create towards the backend server. This does not affect the number of incoming connections, which is always a much larger number.
- project string
and
service_name
- (Required) define the project and service the connection pool belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the connection pool being deleted and new one created instead.- service
Name string Service to link the connection pool to
- username string
is the name of the service user used to connect to the database. This should be defined using reference as shown above to set up dependencies correctly.
- connection_
uri str (Optional) is a computed property that tells the URI for connecting to the pool. This value cannot be set, only read.
- database_
name str is the name of the database the pool connects to. This should be defined using reference as shown above to set up dependencies correctly.
- pool_
mode str is the mode the pool operates in (session, transaction, statement).
- pool_
name str is the name of the pool.
- pool_
size int is the number of connections the pool may create towards the backend server. This does not affect the number of incoming connections, which is always a much larger number.
- project str
and
service_name
- (Required) define the project and service the connection pool belongs to. They should be defined using reference as shown above to set up dependencies correctly. These properties cannot be changed once the service is created. Doing so will result in the connection pool being deleted and new one created instead.- service_
name str Service to link the connection pool to
- username str
is the name of the service user used to connect to the database. This should be defined using reference as shown above to set up dependencies correctly.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aiven
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aiven
Terraform Provider.