scaleway.SdbDatabase
Explore with Pulumi AI
The scaleway.SdbDatabase
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.SdbDatabase("database", {
name: "my-database",
minCpu: 0,
maxCpu: 8,
});
import pulumi
import pulumiverse_scaleway as scaleway
database = scaleway.SdbDatabase("database",
name="my-database",
min_cpu=0,
max_cpu=8)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := scaleway.NewSdbDatabase(ctx, "database", &scaleway.SdbDatabaseArgs{
Name: pulumi.String("my-database"),
MinCpu: pulumi.Int(0),
MaxCpu: pulumi.Int(8),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
var database = new Scaleway.SdbDatabase("database", new()
{
Name = "my-database",
MinCpu = 0,
MaxCpu = 8,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.SdbDatabase;
import com.pulumi.scaleway.SdbDatabaseArgs;
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 SdbDatabase("database", SdbDatabaseArgs.builder()
.name("my-database")
.minCpu(0)
.maxCpu(8)
.build());
}
}
resources:
database:
type: scaleway:SdbDatabase
properties:
name: my-database
minCpu: 0
maxCpu: 8
Create SdbDatabase Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SdbDatabase(name: string, args?: SdbDatabaseArgs, opts?: CustomResourceOptions);
@overload
def SdbDatabase(resource_name: str,
args: Optional[SdbDatabaseArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def SdbDatabase(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 NewSdbDatabase(ctx *Context, name string, args *SdbDatabaseArgs, opts ...ResourceOption) (*SdbDatabase, error)
public SdbDatabase(string name, SdbDatabaseArgs? args = null, CustomResourceOptions? opts = null)
public SdbDatabase(String name, SdbDatabaseArgs args)
public SdbDatabase(String name, SdbDatabaseArgs args, CustomResourceOptions options)
type: scaleway:SdbDatabase
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 SdbDatabaseArgs
- 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 SdbDatabaseArgs
- 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 SdbDatabaseArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SdbDatabaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args SdbDatabaseArgs
- 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 sdbDatabaseResource = new Scaleway.SdbDatabase("sdbDatabaseResource", new()
{
MaxCpu = 0,
MinCpu = 0,
Name = "string",
ProjectId = "string",
Region = "string",
});
example, err := scaleway.NewSdbDatabase(ctx, "sdbDatabaseResource", &scaleway.SdbDatabaseArgs{
MaxCpu: pulumi.Int(0),
MinCpu: pulumi.Int(0),
Name: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Region: pulumi.String("string"),
})
var sdbDatabaseResource = new SdbDatabase("sdbDatabaseResource", SdbDatabaseArgs.builder()
.maxCpu(0)
.minCpu(0)
.name("string")
.projectId("string")
.region("string")
.build());
sdb_database_resource = scaleway.SdbDatabase("sdbDatabaseResource",
max_cpu=0,
min_cpu=0,
name="string",
project_id="string",
region="string")
const sdbDatabaseResource = new scaleway.SdbDatabase("sdbDatabaseResource", {
maxCpu: 0,
minCpu: 0,
name: "string",
projectId: "string",
region: "string",
});
type: scaleway:SdbDatabase
properties:
maxCpu: 0
minCpu: 0
name: string
projectId: string
region: string
SdbDatabase 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 SdbDatabase resource accepts the following input properties:
- 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 string
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- Project
Id string - The project_id you want to attach the resource to
- Region 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 string
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- Project
Id string - The project_id you want to attach the resource to
- Region string
region
) The region in which the resource exists.
- max
Cpu Integer - The maximum number of CPU units for your database. Defaults to 15.
- min
Cpu Integer - The minimum number of CPU units for your database. Defaults to 0.
- name String
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- project
Id String - The project_id you want to attach the resource to
- region String
region
) The region in which the resource exists.
- max
Cpu number - The maximum number of CPU units for your database. Defaults to 15.
- min
Cpu number - The minimum number of CPU units for your database. Defaults to 0.
- name string
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- project
Id string - The project_id you want to attach the resource to
- region 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 str
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- project_
id str - The project_id you want to attach the resource to
- region str
region
) The region in which the resource exists.
- max
Cpu Number - The maximum number of CPU units for your database. Defaults to 15.
- min
Cpu Number - The minimum number of CPU units for your database. Defaults to 0.
- name String
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- project
Id String - The project_id you want to attach the resource to
- region String
region
) The region in which the resource exists.
Outputs
All input properties are implicitly available as output properties. Additionally, the SdbDatabase resource produces the following output properties:
Look up Existing SdbDatabase Resource
Get an existing SdbDatabase 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?: SdbDatabaseState, opts?: CustomResourceOptions): SdbDatabase
@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) -> SdbDatabase
func GetSdbDatabase(ctx *Context, name string, id IDInput, state *SdbDatabaseState, opts ...ResourceOption) (*SdbDatabase, error)
public static SdbDatabase Get(string name, Input<string> id, SdbDatabaseState? state, CustomResourceOptions? opts = null)
public static SdbDatabase get(String name, Output<String> id, SdbDatabaseState 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.
- Endpoint string
- 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 string
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- Project
Id string - The project_id you want to attach the resource to
- Region string
region
) The region in which the resource exists.
- Endpoint string
- 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 string
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- Project
Id string - The project_id you want to attach the resource to
- Region string
region
) The region in which the resource exists.
- endpoint String
- The endpoint of the database.
- max
Cpu Integer - The maximum number of CPU units for your database. Defaults to 15.
- min
Cpu Integer - The minimum number of CPU units for your database. Defaults to 0.
- name String
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- project
Id String - The project_id you want to attach the resource to
- region String
region
) The region in which the resource exists.
- endpoint string
- The endpoint of the database.
- max
Cpu number - The maximum number of CPU units for your database. Defaults to 15.
- min
Cpu number - The minimum number of CPU units for your database. Defaults to 0.
- name string
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- project
Id string - The project_id you want to attach the resource to
- region 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 str
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- project_
id str - The project_id you want to attach the resource to
- region str
region
) The region in which the resource exists.
- endpoint String
- The endpoint of the database.
- max
Cpu Number - The maximum number of CPU units for your database. Defaults to 15.
- min
Cpu Number - The minimum number of CPU units for your database. Defaults to 0.
- name String
The name of the database (e.g.
my-new-database
).Important: Updates to the
name
argument will recreate the database.- project
Id String - The project_id you want to attach the resource to
- region 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:index/sdbDatabase:SdbDatabase database fr-par/11111111-1111-1111-1111-111111111111
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.