Aiven

v5.4.0 published on Monday, Sep 12, 2022 by Pulumi

ConnectionPool

The Connection Pool resource allows the creation and management of Aiven Connection Pools.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aiven = Pulumi.Aiven;

return await Deployment.RunAsync(() => 
{
    var mytestpool = new Aiven.ConnectionPool("mytestpool", new()
    {
        Project = aiven_project.Myproject.Project,
        ServiceName = aiven_service.Myservice.Service_name,
        DatabaseName = aiven_database.Mydatabase.Database_name,
        PoolMode = "transaction",
        PoolName = "mypool",
        PoolSize = 10,
        Username = aiven_service_user.Myserviceuser.Username,
    });

});
package main

import (
	"github.com/pulumi/pulumi-aiven/sdk/v5/go/aiven"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := aiven.NewConnectionPool(ctx, "mytestpool", &aiven.ConnectionPoolArgs{
			Project:      pulumi.Any(aiven_project.Myproject.Project),
			ServiceName:  pulumi.Any(aiven_service.Myservice.Service_name),
			DatabaseName: pulumi.Any(aiven_database.Mydatabase.Database_name),
			PoolMode:     pulumi.String("transaction"),
			PoolName:     pulumi.String("mypool"),
			PoolSize:     pulumi.Int(10),
			Username:     pulumi.Any(aiven_service_user.Myserviceuser.Username),
		})
		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.aiven.ConnectionPool;
import com.pulumi.aiven.ConnectionPoolArgs;
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 mytestpool = new ConnectionPool("mytestpool", ConnectionPoolArgs.builder()        
            .project(aiven_project.myproject().project())
            .serviceName(aiven_service.myservice().service_name())
            .databaseName(aiven_database.mydatabase().database_name())
            .poolMode("transaction")
            .poolName("mypool")
            .poolSize(10)
            .username(aiven_service_user.myserviceuser().username())
            .build());

    }
}
import pulumi
import pulumi_aiven as aiven

mytestpool = aiven.ConnectionPool("mytestpool",
    project=aiven_project["myproject"]["project"],
    service_name=aiven_service["myservice"]["service_name"],
    database_name=aiven_database["mydatabase"]["database_name"],
    pool_mode="transaction",
    pool_name="mypool",
    pool_size=10,
    username=aiven_service_user["myserviceuser"]["username"])
import * as pulumi from "@pulumi/pulumi";
import * as aiven from "@pulumi/aiven";

const mytestpool = new aiven.ConnectionPool("mytestpool", {
    project: aiven_project.myproject.project,
    serviceName: aiven_service.myservice.service_name,
    databaseName: aiven_database.mydatabase.database_name,
    poolMode: "transaction",
    poolName: "mypool",
    poolSize: 10,
    username: aiven_service_user.myserviceuser.username,
});
resources:
  mytestpool:
    type: aiven:ConnectionPool
    properties:
      project: ${aiven_project.myproject.project}
      serviceName: ${aiven_service.myservice.service_name}
      databaseName: ${aiven_database.mydatabase.database_name}
      poolMode: transaction
      poolName: mypool
      poolSize: 10
      username: ${aiven_service_user.myserviceuser.username}

Create ConnectionPool Resource

new ConnectionPool(name: string, args: ConnectionPoolArgs, opts?: CustomResourceOptions);
@overload
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)
@overload
def ConnectionPool(resource_name: str,
                   args: ConnectionPoolArgs,
                   opts: Optional[ResourceOptions] = None)
func NewConnectionPool(ctx *Context, name string, args ConnectionPoolArgs, opts ...ResourceOption) (*ConnectionPool, error)
public ConnectionPool(string name, ConnectionPoolArgs args, CustomResourceOptions? opts = null)
public ConnectionPool(String name, ConnectionPoolArgs args)
public ConnectionPool(String name, ConnectionPoolArgs args, CustomResourceOptions options)
type: aiven:ConnectionPool
properties: # The arguments to resource properties.
options: # 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.
resource_name str
The unique name of the resource.
args ConnectionPoolArgs
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 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.
name String
The unique name of the resource.
args ConnectionPoolArgs
The arguments to resource properties.
options 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 Architecture and Concepts docs.

Inputs

The ConnectionPool resource accepts the following input properties:

DatabaseName string

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

PoolName string

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

Project string

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

ServiceName string

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

PoolMode string

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

PoolSize int

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. The default value is 10.

Username string

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

DatabaseName string

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

PoolName string

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

Project string

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

ServiceName string

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

PoolMode string

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

PoolSize int

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. The default value is 10.

Username string

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

databaseName String

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

poolName String

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

project String

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

serviceName String

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

poolMode String

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

poolSize Integer

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. The default value is 10.

username String

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

databaseName string

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

poolName string

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

project string

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

serviceName string

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

poolMode string

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

poolSize number

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. The default value is 10.

username string

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

database_name str

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

pool_name str

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

project str

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

service_name str

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

pool_mode str

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

pool_size int

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. The default value is 10.

username str

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

databaseName String

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

poolName String

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

project String

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

serviceName String

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

poolMode String

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

poolSize Number

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. The default value is 10.

username String

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

Outputs

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

ConnectionUri string

The URI for connecting to the pool

Id string

The provider-assigned unique ID for this managed resource.

ConnectionUri string

The URI for connecting to the pool

Id string

The provider-assigned unique ID for this managed resource.

connectionUri String

The URI for connecting to the pool

id String

The provider-assigned unique ID for this managed resource.

connectionUri string

The URI for connecting to the pool

id string

The provider-assigned unique ID for this managed resource.

connection_uri str

The URI for connecting to the pool

id str

The provider-assigned unique ID for this managed resource.

connectionUri String

The URI for connecting to the pool

id String

The provider-assigned unique ID for this managed resource.

Look up 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)
public static ConnectionPool get(String name, Output<String> id, ConnectionPoolState 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:
ConnectionUri string

The URI for connecting to the pool

DatabaseName string

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

PoolMode string

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

PoolName string

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

PoolSize int

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. The default value is 10.

Project string

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

ServiceName string

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

Username string

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

ConnectionUri string

The URI for connecting to the pool

DatabaseName string

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

PoolMode string

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

PoolName string

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

PoolSize int

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. The default value is 10.

Project string

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

ServiceName string

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

Username string

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

connectionUri String

The URI for connecting to the pool

databaseName String

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

poolMode String

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

poolName String

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

poolSize Integer

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. The default value is 10.

project String

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

serviceName String

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

username String

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

connectionUri string

The URI for connecting to the pool

databaseName string

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

poolMode string

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

poolName string

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

poolSize number

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. The default value is 10.

project string

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

serviceName string

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

username string

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

connection_uri str

The URI for connecting to the pool

database_name str

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

pool_mode str

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

pool_name str

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

pool_size int

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. The default value is 10.

project str

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

service_name str

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

username str

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

connectionUri String

The URI for connecting to the pool

databaseName String

The name of the database the pool connects to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

poolMode String

The mode the pool operates in The possible values are session, transaction and statement. The default value is transaction.

poolName String

The name of the created pool. This property cannot be changed, doing so forces recreation of the resource.

poolSize Number

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. The default value is 10.

project String

Identifies the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

serviceName String

Specifies the name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. This property cannot be changed, doing so forces recreation of the resource.

username String

The name of the service user used to connect to the database. To set up proper dependencies please refer to this variable as a reference.

Import

 $ pulumi import aiven:index/connectionPool:ConnectionPool mytestpool project/service_name/pool_name

Package Details

Repository
https://github.com/pulumi/pulumi-aiven
License
Apache-2.0
Notes

This Pulumi package is based on the aiven Terraform Provider.