published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
The Database resource allows the creation and management of Aiven Databases.
Example Usage
using Pulumi;
using Aiven = Pulumi.Aiven;
class MyStack : Stack
{
public MyStack()
{
var mydatabase = new Aiven.Database("mydatabase", new Aiven.DatabaseArgs
{
Project = aiven_project.Myproject.Project,
ServiceName = aiven_service.Myservice.Service_name,
DatabaseName = "<DATABASE_NAME>",
});
}
}
package main
import (
"github.com/pulumi/pulumi-aiven/sdk/v4/go/aiven"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := aiven.NewDatabase(ctx, "mydatabase", &aiven.DatabaseArgs{
Project: pulumi.Any(aiven_project.Myproject.Project),
ServiceName: pulumi.Any(aiven_service.Myservice.Service_name),
DatabaseName: pulumi.String("<DATABASE_NAME>"),
})
if err != nil {
return err
}
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as aiven from "@pulumi/aiven";
const mydatabase = new aiven.Database("mydatabase", {
project: aiven_project.myproject.project,
serviceName: aiven_service.myservice.service_name,
databaseName: "<DATABASE_NAME>",
});
import pulumi
import pulumi_aiven as aiven
mydatabase = aiven.Database("mydatabase",
project=aiven_project["myproject"]["project"],
service_name=aiven_service["myservice"]["service_name"],
database_name="<DATABASE_NAME>")
Example coming soon!
Create Database Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Database(name: string, args: DatabaseArgs, opts?: CustomResourceOptions);@overload
def Database(resource_name: str,
args: DatabaseArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Database(resource_name: str,
opts: Optional[ResourceOptions] = None,
database_name: Optional[str] = None,
project: Optional[str] = None,
service_name: Optional[str] = None,
lc_collate: Optional[str] = None,
lc_ctype: Optional[str] = None,
termination_protection: Optional[bool] = None)func NewDatabase(ctx *Context, name string, args DatabaseArgs, opts ...ResourceOption) (*Database, error)public Database(string name, DatabaseArgs args, CustomResourceOptions? opts = null)
public Database(String name, DatabaseArgs args)
public Database(String name, DatabaseArgs args, CustomResourceOptions options)
type: aiven:Database
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args DatabaseArgs
- 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 DatabaseArgs
- 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 DatabaseArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatabaseArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var databaseResource = new Aiven.Database("databaseResource", new()
{
DatabaseName = "string",
Project = "string",
ServiceName = "string",
LcCollate = "string",
LcCtype = "string",
TerminationProtection = false,
});
example, err := aiven.NewDatabase(ctx, "databaseResource", &aiven.DatabaseArgs{
DatabaseName: pulumi.String("string"),
Project: pulumi.String("string"),
ServiceName: pulumi.String("string"),
LcCollate: pulumi.String("string"),
LcCtype: pulumi.String("string"),
TerminationProtection: pulumi.Bool(false),
})
var databaseResource = new Database("databaseResource", DatabaseArgs.builder()
.databaseName("string")
.project("string")
.serviceName("string")
.lcCollate("string")
.lcCtype("string")
.terminationProtection(false)
.build());
database_resource = aiven.Database("databaseResource",
database_name="string",
project="string",
service_name="string",
lc_collate="string",
lc_ctype="string",
termination_protection=False)
const databaseResource = new aiven.Database("databaseResource", {
databaseName: "string",
project: "string",
serviceName: "string",
lcCollate: "string",
lcCtype: "string",
terminationProtection: false,
});
type: aiven:Database
properties:
databaseName: string
lcCollate: string
lcCtype: string
project: string
serviceName: string
terminationProtection: false
Database Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Database resource accepts the following input properties:
- Database
Name string - The name of the service database. 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.
- Service
Name 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.
- Lc
Collate string - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - Lc
Ctype string - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - Termination
Protection bool - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- Database
Name string - The name of the service database. 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.
- Service
Name 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.
- Lc
Collate string - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - Lc
Ctype string - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - Termination
Protection bool - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- database
Name String - The name of the service database. 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.
- service
Name 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.
- lc
Collate String - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - lc
Ctype String - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - termination
Protection Boolean - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- database
Name string - The name of the service database. 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.
- service
Name 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.
- lc
Collate string - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - lc
Ctype string - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - termination
Protection boolean - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- database_
name str - The name of the service database. 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.
- lc_
collate str - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - lc_
ctype str - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - termination_
protection bool - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- database
Name String - The name of the service database. 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.
- service
Name 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.
- lc
Collate String - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - lc
Ctype String - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - termination
Protection Boolean - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
Outputs
All input properties are implicitly available as output properties. Additionally, the Database resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Database Resource
Get an existing Database 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?: DatabaseState, opts?: CustomResourceOptions): Database@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
database_name: Optional[str] = None,
lc_collate: Optional[str] = None,
lc_ctype: Optional[str] = None,
project: Optional[str] = None,
service_name: Optional[str] = None,
termination_protection: Optional[bool] = None) -> Databasefunc GetDatabase(ctx *Context, name string, id IDInput, state *DatabaseState, opts ...ResourceOption) (*Database, error)public static Database Get(string name, Input<string> id, DatabaseState? state, CustomResourceOptions? opts = null)public static Database get(String name, Output<String> id, DatabaseState state, CustomResourceOptions options)resources: _: type: aiven:Database get: id: ${id}- 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.
- Database
Name string - The name of the service database. This property cannot be changed, doing so forces recreation of the resource.
- Lc
Collate string - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - Lc
Ctype string - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. 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.
- Service
Name 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.
- Termination
Protection bool - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- Database
Name string - The name of the service database. This property cannot be changed, doing so forces recreation of the resource.
- Lc
Collate string - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - Lc
Ctype string - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. 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.
- Service
Name 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.
- Termination
Protection bool - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- database
Name String - The name of the service database. This property cannot be changed, doing so forces recreation of the resource.
- lc
Collate String - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - lc
Ctype String - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. 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.
- service
Name 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.
- termination
Protection Boolean - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- database
Name string - The name of the service database. This property cannot be changed, doing so forces recreation of the resource.
- lc
Collate string - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - lc
Ctype string - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. 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.
- service
Name 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.
- termination
Protection boolean - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- database_
name str - The name of the service database. This property cannot be changed, doing so forces recreation of the resource.
- lc_
collate str - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - lc_
ctype str - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. 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.
- termination_
protection bool - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
- database
Name String - The name of the service database. This property cannot be changed, doing so forces recreation of the resource.
- lc
Collate String - Default string sort order (
LC_COLLATE) of the database. The default value isen_US.UTF-8. This property cannot be changed, doing so forces recreation of the resource. - lc
Ctype String - Default character classification (
LC_CTYPE) of the database. The default value isen_US.UTF-8. 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.
- service
Name 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.
- termination
Protection Boolean - It is a Terraform client-side deletion protections, which prevents the database from being deleted by Terraform. It is
recommended to enable this for any production databases containing critical data. The default value is
false.
Package Details
- Repository
- Aiven pulumi/pulumi-aiven
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aivenTerraform Provider.
published on Monday, Mar 9, 2026 by Pulumi
