1. Packages
  2. Scaleway
  3. API Docs
  4. databases
  5. ServerlessDatabase
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.databases.ServerlessDatabase

Explore with Pulumi AI

The scaleway.databases.ServerlessDatabase resource allows you to create and manage databases for Scaleway Serverless SQL Databases.

Refer to the Serverless SQL Databases documentation and API documentation for more information.

Example Usage

Basic

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";

const database = new scaleway.databases.ServerlessDatabase("database", {
    name: "my-database",
    minCpu: 0,
    maxCpu: 8,
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

database = scaleway.databases.ServerlessDatabase("database",
    name="my-database",
    min_cpu=0,
    max_cpu=8)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/databases"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := databases.NewServerlessDatabase(ctx, "database", &databases.ServerlessDatabaseArgs{
			Name:   pulumi.String("my-database"),
			MinCpu: pulumi.Int(0),
			MaxCpu: pulumi.Int(8),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;

return await Deployment.RunAsync(() => 
{
    var database = new Scaleway.Databases.ServerlessDatabase("database", new()
    {
        Name = "my-database",
        MinCpu = 0,
        MaxCpu = 8,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.databases.ServerlessDatabase;
import com.pulumi.scaleway.databases.ServerlessDatabaseArgs;
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 database = new ServerlessDatabase("database", ServerlessDatabaseArgs.builder()
            .name("my-database")
            .minCpu(0)
            .maxCpu(8)
            .build());

    }
}
Copy
resources:
  database:
    type: scaleway:databases:ServerlessDatabase
    properties:
      name: my-database
      minCpu: 0
      maxCpu: 8
Copy

Create ServerlessDatabase Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ServerlessDatabase(name: string, args?: ServerlessDatabaseArgs, opts?: CustomResourceOptions);
@overload
def ServerlessDatabase(resource_name: str,
                       args: Optional[ServerlessDatabaseArgs] = None,
                       opts: Optional[ResourceOptions] = None)

@overload
def ServerlessDatabase(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       max_cpu: Optional[int] = None,
                       min_cpu: Optional[int] = None,
                       name: Optional[str] = None,
                       project_id: Optional[str] = None,
                       region: Optional[str] = None)
func NewServerlessDatabase(ctx *Context, name string, args *ServerlessDatabaseArgs, opts ...ResourceOption) (*ServerlessDatabase, error)
public ServerlessDatabase(string name, ServerlessDatabaseArgs? args = null, CustomResourceOptions? opts = null)
public ServerlessDatabase(String name, ServerlessDatabaseArgs args)
public ServerlessDatabase(String name, ServerlessDatabaseArgs args, CustomResourceOptions options)
type: scaleway:databases:ServerlessDatabase
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args ServerlessDatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args ServerlessDatabaseArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args ServerlessDatabaseArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args ServerlessDatabaseArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ServerlessDatabaseArgs
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 serverlessDatabaseResource = new Scaleway.Databases.ServerlessDatabase("serverlessDatabaseResource", new()
{
    MaxCpu = 0,
    MinCpu = 0,
    Name = "string",
    ProjectId = "string",
    Region = "string",
});
Copy
example, err := databases.NewServerlessDatabase(ctx, "serverlessDatabaseResource", &databases.ServerlessDatabaseArgs{
	MaxCpu:    pulumi.Int(0),
	MinCpu:    pulumi.Int(0),
	Name:      pulumi.String("string"),
	ProjectId: pulumi.String("string"),
	Region:    pulumi.String("string"),
})
Copy
var serverlessDatabaseResource = new ServerlessDatabase("serverlessDatabaseResource", ServerlessDatabaseArgs.builder()
    .maxCpu(0)
    .minCpu(0)
    .name("string")
    .projectId("string")
    .region("string")
    .build());
Copy
serverless_database_resource = scaleway.databases.ServerlessDatabase("serverlessDatabaseResource",
    max_cpu=0,
    min_cpu=0,
    name="string",
    project_id="string",
    region="string")
Copy
const serverlessDatabaseResource = new scaleway.databases.ServerlessDatabase("serverlessDatabaseResource", {
    maxCpu: 0,
    minCpu: 0,
    name: "string",
    projectId: "string",
    region: "string",
});
Copy
type: scaleway:databases:ServerlessDatabase
properties:
    maxCpu: 0
    minCpu: 0
    name: string
    projectId: string
    region: string
Copy

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

MaxCpu int
The maximum number of CPU units for your database. Defaults to 15.
MinCpu int
The minimum number of CPU units for your database. Defaults to 0.
Name Changes to this property will trigger replacement. string

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

ProjectId Changes to this property will trigger replacement. string
The project_id you want to attach the resource to
Region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
MaxCpu int
The maximum number of CPU units for your database. Defaults to 15.
MinCpu int
The minimum number of CPU units for your database. Defaults to 0.
Name Changes to this property will trigger replacement. string

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

ProjectId Changes to this property will trigger replacement. string
The project_id you want to attach the resource to
Region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
maxCpu Integer
The maximum number of CPU units for your database. Defaults to 15.
minCpu Integer
The minimum number of CPU units for your database. Defaults to 0.
name Changes to this property will trigger replacement. String

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

projectId Changes to this property will trigger replacement. String
The project_id you want to attach the resource to
region Changes to this property will trigger replacement. String
region) The region in which the resource exists.
maxCpu number
The maximum number of CPU units for your database. Defaults to 15.
minCpu number
The minimum number of CPU units for your database. Defaults to 0.
name Changes to this property will trigger replacement. string

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

projectId Changes to this property will trigger replacement. string
The project_id you want to attach the resource to
region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
max_cpu int
The maximum number of CPU units for your database. Defaults to 15.
min_cpu int
The minimum number of CPU units for your database. Defaults to 0.
name Changes to this property will trigger replacement. str

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

project_id Changes to this property will trigger replacement. str
The project_id you want to attach the resource to
region Changes to this property will trigger replacement. str
region) The region in which the resource exists.
maxCpu Number
The maximum number of CPU units for your database. Defaults to 15.
minCpu Number
The minimum number of CPU units for your database. Defaults to 0.
name Changes to this property will trigger replacement. String

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

projectId Changes to this property will trigger replacement. String
The project_id you want to attach the resource to
region Changes to this property will trigger replacement. String
region) The region in which the resource exists.

Outputs

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

Endpoint string
The endpoint of the database.
Id string
The provider-assigned unique ID for this managed resource.
Endpoint string
The endpoint of the database.
Id string
The provider-assigned unique ID for this managed resource.
endpoint String
The endpoint of the database.
id String
The provider-assigned unique ID for this managed resource.
endpoint string
The endpoint of the database.
id string
The provider-assigned unique ID for this managed resource.
endpoint str
The endpoint of the database.
id str
The provider-assigned unique ID for this managed resource.
endpoint String
The endpoint of the database.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ServerlessDatabase Resource

Get an existing ServerlessDatabase 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?: ServerlessDatabaseState, opts?: CustomResourceOptions): ServerlessDatabase
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        endpoint: Optional[str] = None,
        max_cpu: Optional[int] = None,
        min_cpu: Optional[int] = None,
        name: Optional[str] = None,
        project_id: Optional[str] = None,
        region: Optional[str] = None) -> ServerlessDatabase
func GetServerlessDatabase(ctx *Context, name string, id IDInput, state *ServerlessDatabaseState, opts ...ResourceOption) (*ServerlessDatabase, error)
public static ServerlessDatabase Get(string name, Input<string> id, ServerlessDatabaseState? state, CustomResourceOptions? opts = null)
public static ServerlessDatabase get(String name, Output<String> id, ServerlessDatabaseState state, CustomResourceOptions options)
resources:  _:    type: scaleway:databases:ServerlessDatabase    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Endpoint string
The endpoint of the database.
MaxCpu int
The maximum number of CPU units for your database. Defaults to 15.
MinCpu int
The minimum number of CPU units for your database. Defaults to 0.
Name Changes to this property will trigger replacement. string

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

ProjectId Changes to this property will trigger replacement. string
The project_id you want to attach the resource to
Region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
Endpoint string
The endpoint of the database.
MaxCpu int
The maximum number of CPU units for your database. Defaults to 15.
MinCpu int
The minimum number of CPU units for your database. Defaults to 0.
Name Changes to this property will trigger replacement. string

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

ProjectId Changes to this property will trigger replacement. string
The project_id you want to attach the resource to
Region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
endpoint String
The endpoint of the database.
maxCpu Integer
The maximum number of CPU units for your database. Defaults to 15.
minCpu Integer
The minimum number of CPU units for your database. Defaults to 0.
name Changes to this property will trigger replacement. String

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

projectId Changes to this property will trigger replacement. String
The project_id you want to attach the resource to
region Changes to this property will trigger replacement. String
region) The region in which the resource exists.
endpoint string
The endpoint of the database.
maxCpu number
The maximum number of CPU units for your database. Defaults to 15.
minCpu number
The minimum number of CPU units for your database. Defaults to 0.
name Changes to this property will trigger replacement. string

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

projectId Changes to this property will trigger replacement. string
The project_id you want to attach the resource to
region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
endpoint str
The endpoint of the database.
max_cpu int
The maximum number of CPU units for your database. Defaults to 15.
min_cpu int
The minimum number of CPU units for your database. Defaults to 0.
name Changes to this property will trigger replacement. str

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

project_id Changes to this property will trigger replacement. str
The project_id you want to attach the resource to
region Changes to this property will trigger replacement. str
region) The region in which the resource exists.
endpoint String
The endpoint of the database.
maxCpu Number
The maximum number of CPU units for your database. Defaults to 15.
minCpu Number
The minimum number of CPU units for your database. Defaults to 0.
name Changes to this property will trigger replacement. String

The name of the database (e.g. my-new-database).

Important: Updates to the name argument will recreate the database.

projectId Changes to this property will trigger replacement. String
The project_id you want to attach the resource to
region Changes to this property will trigger replacement. String
region) The region in which the resource exists.

Import

Serverless SQL Databases can be imported using the {region}/{id}, as shown below:

bash

$ pulumi import scaleway:databases/serverlessDatabase:ServerlessDatabase database fr-par/11111111-1111-1111-1111-111111111111
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
scaleway pulumiverse/pulumi-scaleway
License
Apache-2.0
Notes
This Pulumi package is based on the scaleway Terraform Provider.