1. Packages
  2. Scaleway
  3. API Docs
  4. DatabaseBackup
Scaleway v1.25.0 published on Saturday, Mar 22, 2025 by pulumiverse

scaleway.DatabaseBackup

Explore with Pulumi AI

Deprecated: scaleway.index/databasebackup.DatabaseBackup has been deprecated in favor of scaleway.databases/databasebackup.DatabaseBackup

Creates and manages database backups. For more information, refer to the API documentation.

Example Usage

Basic

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

const main = new scaleway.databases.Instance("main", {
    name: "test-rdb",
    nodeType: "DB-DEV-S",
    engine: "PostgreSQL-15",
    isHaCluster: true,
    disableBackup: true,
    userName: "my_initial_user",
    password: "thiZ_is_v&ry_s3cret",
});
const mainDatabase = new scaleway.databases.Database("main", {
    instanceId: main.id,
    name: "database",
});
const mainDatabaseBackup = new scaleway.databases.DatabaseBackup("main", {
    instanceId: main.id,
    databaseName: mainDatabase.name,
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

main = scaleway.databases.Instance("main",
    name="test-rdb",
    node_type="DB-DEV-S",
    engine="PostgreSQL-15",
    is_ha_cluster=True,
    disable_backup=True,
    user_name="my_initial_user",
    password="thiZ_is_v&ry_s3cret")
main_database = scaleway.databases.Database("main",
    instance_id=main.id,
    name="database")
main_database_backup = scaleway.databases.DatabaseBackup("main",
    instance_id=main.id,
    database_name=main_database.name)
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 {
		main, err := databases.NewInstance(ctx, "main", &databases.InstanceArgs{
			Name:          pulumi.String("test-rdb"),
			NodeType:      pulumi.String("DB-DEV-S"),
			Engine:        pulumi.String("PostgreSQL-15"),
			IsHaCluster:   pulumi.Bool(true),
			DisableBackup: pulumi.Bool(true),
			UserName:      pulumi.String("my_initial_user"),
			Password:      pulumi.String("thiZ_is_v&ry_s3cret"),
		})
		if err != nil {
			return err
		}
		mainDatabase, err := databases.NewDatabase(ctx, "main", &databases.DatabaseArgs{
			InstanceId: main.ID(),
			Name:       pulumi.String("database"),
		})
		if err != nil {
			return err
		}
		_, err = databases.NewDatabaseBackup(ctx, "main", &databases.DatabaseBackupArgs{
			InstanceId:   main.ID(),
			DatabaseName: mainDatabase.Name,
		})
		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 main = new Scaleway.Databases.Instance("main", new()
    {
        Name = "test-rdb",
        NodeType = "DB-DEV-S",
        Engine = "PostgreSQL-15",
        IsHaCluster = true,
        DisableBackup = true,
        UserName = "my_initial_user",
        Password = "thiZ_is_v&ry_s3cret",
    });

    var mainDatabase = new Scaleway.Databases.Database("main", new()
    {
        InstanceId = main.Id,
        Name = "database",
    });

    var mainDatabaseBackup = new Scaleway.Databases.DatabaseBackup("main", new()
    {
        InstanceId = main.Id,
        DatabaseName = mainDatabase.Name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.databases.Instance;
import com.pulumi.scaleway.databases.InstanceArgs;
import com.pulumi.scaleway.databases.Database;
import com.pulumi.scaleway.databases.DatabaseArgs;
import com.pulumi.scaleway.databases.DatabaseBackup;
import com.pulumi.scaleway.databases.DatabaseBackupArgs;
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 main = new Instance("main", InstanceArgs.builder()
            .name("test-rdb")
            .nodeType("DB-DEV-S")
            .engine("PostgreSQL-15")
            .isHaCluster(true)
            .disableBackup(true)
            .userName("my_initial_user")
            .password("thiZ_is_v&ry_s3cret")
            .build());

        var mainDatabase = new Database("mainDatabase", DatabaseArgs.builder()
            .instanceId(main.id())
            .name("database")
            .build());

        var mainDatabaseBackup = new DatabaseBackup("mainDatabaseBackup", DatabaseBackupArgs.builder()
            .instanceId(main.id())
            .databaseName(mainDatabase.name())
            .build());

    }
}
Copy
resources:
  main:
    type: scaleway:databases:Instance
    properties:
      name: test-rdb
      nodeType: DB-DEV-S
      engine: PostgreSQL-15
      isHaCluster: true
      disableBackup: true
      userName: my_initial_user
      password: thiZ_is_v&ry_s3cret
  mainDatabase:
    type: scaleway:databases:Database
    name: main
    properties:
      instanceId: ${main.id}
      name: database
  mainDatabaseBackup:
    type: scaleway:databases:DatabaseBackup
    name: main
    properties:
      instanceId: ${main.id}
      databaseName: ${mainDatabase.name}
Copy

With expiration

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

const main = new scaleway.databases.DatabaseBackup("main", {
    instanceId: mainScalewayRdbInstance.id,
    databaseName: mainScalewayRdbDatabase.name,
    expiresAt: "2022-06-16T07:48:44Z",
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

main = scaleway.databases.DatabaseBackup("main",
    instance_id=main_scaleway_rdb_instance["id"],
    database_name=main_scaleway_rdb_database["name"],
    expires_at="2022-06-16T07:48:44Z")
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.NewDatabaseBackup(ctx, "main", &databases.DatabaseBackupArgs{
			InstanceId:   pulumi.Any(mainScalewayRdbInstance.Id),
			DatabaseName: pulumi.Any(mainScalewayRdbDatabase.Name),
			ExpiresAt:    pulumi.String("2022-06-16T07:48:44Z"),
		})
		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 main = new Scaleway.Databases.DatabaseBackup("main", new()
    {
        InstanceId = mainScalewayRdbInstance.Id,
        DatabaseName = mainScalewayRdbDatabase.Name,
        ExpiresAt = "2022-06-16T07:48:44Z",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.databases.DatabaseBackup;
import com.pulumi.scaleway.databases.DatabaseBackupArgs;
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 main = new DatabaseBackup("main", DatabaseBackupArgs.builder()
            .instanceId(mainScalewayRdbInstance.id())
            .databaseName(mainScalewayRdbDatabase.name())
            .expiresAt("2022-06-16T07:48:44Z")
            .build());

    }
}
Copy
resources:
  main:
    type: scaleway:databases:DatabaseBackup
    properties:
      instanceId: ${mainScalewayRdbInstance.id}
      databaseName: ${mainScalewayRdbDatabase.name}
      expiresAt: 2022-06-16T07:48:44Z
Copy

Create DatabaseBackup Resource

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

Constructor syntax

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

@overload
def DatabaseBackup(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   database_name: Optional[str] = None,
                   expires_at: Optional[str] = None,
                   instance_id: Optional[str] = None,
                   name: Optional[str] = None,
                   region: Optional[str] = None)
func NewDatabaseBackup(ctx *Context, name string, args DatabaseBackupArgs, opts ...ResourceOption) (*DatabaseBackup, error)
public DatabaseBackup(string name, DatabaseBackupArgs args, CustomResourceOptions? opts = null)
public DatabaseBackup(String name, DatabaseBackupArgs args)
public DatabaseBackup(String name, DatabaseBackupArgs args, CustomResourceOptions options)
type: scaleway:DatabaseBackup
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 This property is required. DatabaseBackupArgs
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 This property is required. DatabaseBackupArgs
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 This property is required. DatabaseBackupArgs
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 This property is required. DatabaseBackupArgs
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. DatabaseBackupArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

DatabaseName
This property is required.
Changes to this property will trigger replacement.
string
Name of the database of this backup.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

ExpiresAt string

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

Name string
Name of the database (e.g. my-database).
Region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
DatabaseName
This property is required.
Changes to this property will trigger replacement.
string
Name of the database of this backup.
InstanceId
This property is required.
Changes to this property will trigger replacement.
string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

ExpiresAt string

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

Name string
Name of the database (e.g. my-database).
Region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
databaseName
This property is required.
Changes to this property will trigger replacement.
String
Name of the database of this backup.
instanceId
This property is required.
Changes to this property will trigger replacement.
String

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

expiresAt String

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

name String
Name of the database (e.g. my-database).
region Changes to this property will trigger replacement. String
region) The region in which the resource exists.
databaseName
This property is required.
Changes to this property will trigger replacement.
string
Name of the database of this backup.
instanceId
This property is required.
Changes to this property will trigger replacement.
string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

expiresAt string

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

name string
Name of the database (e.g. my-database).
region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
database_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the database of this backup.
instance_id
This property is required.
Changes to this property will trigger replacement.
str

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

expires_at str

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

name str
Name of the database (e.g. my-database).
region Changes to this property will trigger replacement. str
region) The region in which the resource exists.
databaseName
This property is required.
Changes to this property will trigger replacement.
String
Name of the database of this backup.
instanceId
This property is required.
Changes to this property will trigger replacement.
String

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

expiresAt String

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

name String
Name of the database (e.g. my-database).
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 DatabaseBackup resource produces the following output properties:

CreatedAt string
Creation date (Format ISO 8601).
Id string
The provider-assigned unique ID for this managed resource.
InstanceName string
Name of the instance of the backup.
Size int
Size of the backup (in bytes).
UpdatedAt string
Updated date (Format ISO 8601).
CreatedAt string
Creation date (Format ISO 8601).
Id string
The provider-assigned unique ID for this managed resource.
InstanceName string
Name of the instance of the backup.
Size int
Size of the backup (in bytes).
UpdatedAt string
Updated date (Format ISO 8601).
createdAt String
Creation date (Format ISO 8601).
id String
The provider-assigned unique ID for this managed resource.
instanceName String
Name of the instance of the backup.
size Integer
Size of the backup (in bytes).
updatedAt String
Updated date (Format ISO 8601).
createdAt string
Creation date (Format ISO 8601).
id string
The provider-assigned unique ID for this managed resource.
instanceName string
Name of the instance of the backup.
size number
Size of the backup (in bytes).
updatedAt string
Updated date (Format ISO 8601).
created_at str
Creation date (Format ISO 8601).
id str
The provider-assigned unique ID for this managed resource.
instance_name str
Name of the instance of the backup.
size int
Size of the backup (in bytes).
updated_at str
Updated date (Format ISO 8601).
createdAt String
Creation date (Format ISO 8601).
id String
The provider-assigned unique ID for this managed resource.
instanceName String
Name of the instance of the backup.
size Number
Size of the backup (in bytes).
updatedAt String
Updated date (Format ISO 8601).

Look up Existing DatabaseBackup Resource

Get an existing DatabaseBackup 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?: DatabaseBackupState, opts?: CustomResourceOptions): DatabaseBackup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        database_name: Optional[str] = None,
        expires_at: Optional[str] = None,
        instance_id: Optional[str] = None,
        instance_name: Optional[str] = None,
        name: Optional[str] = None,
        region: Optional[str] = None,
        size: Optional[int] = None,
        updated_at: Optional[str] = None) -> DatabaseBackup
func GetDatabaseBackup(ctx *Context, name string, id IDInput, state *DatabaseBackupState, opts ...ResourceOption) (*DatabaseBackup, error)
public static DatabaseBackup Get(string name, Input<string> id, DatabaseBackupState? state, CustomResourceOptions? opts = null)
public static DatabaseBackup get(String name, Output<String> id, DatabaseBackupState state, CustomResourceOptions options)
resources:  _:    type: scaleway:DatabaseBackup    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:
CreatedAt string
Creation date (Format ISO 8601).
DatabaseName Changes to this property will trigger replacement. string
Name of the database of this backup.
ExpiresAt string

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

InstanceId Changes to this property will trigger replacement. string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

InstanceName string
Name of the instance of the backup.
Name string
Name of the database (e.g. my-database).
Region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
Size int
Size of the backup (in bytes).
UpdatedAt string
Updated date (Format ISO 8601).
CreatedAt string
Creation date (Format ISO 8601).
DatabaseName Changes to this property will trigger replacement. string
Name of the database of this backup.
ExpiresAt string

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

InstanceId Changes to this property will trigger replacement. string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

InstanceName string
Name of the instance of the backup.
Name string
Name of the database (e.g. my-database).
Region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
Size int
Size of the backup (in bytes).
UpdatedAt string
Updated date (Format ISO 8601).
createdAt String
Creation date (Format ISO 8601).
databaseName Changes to this property will trigger replacement. String
Name of the database of this backup.
expiresAt String

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

instanceId Changes to this property will trigger replacement. String

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

instanceName String
Name of the instance of the backup.
name String
Name of the database (e.g. my-database).
region Changes to this property will trigger replacement. String
region) The region in which the resource exists.
size Integer
Size of the backup (in bytes).
updatedAt String
Updated date (Format ISO 8601).
createdAt string
Creation date (Format ISO 8601).
databaseName Changes to this property will trigger replacement. string
Name of the database of this backup.
expiresAt string

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

instanceId Changes to this property will trigger replacement. string

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

instanceName string
Name of the instance of the backup.
name string
Name of the database (e.g. my-database).
region Changes to this property will trigger replacement. string
region) The region in which the resource exists.
size number
Size of the backup (in bytes).
updatedAt string
Updated date (Format ISO 8601).
created_at str
Creation date (Format ISO 8601).
database_name Changes to this property will trigger replacement. str
Name of the database of this backup.
expires_at str

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

instance_id Changes to this property will trigger replacement. str

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

instance_name str
Name of the instance of the backup.
name str
Name of the database (e.g. my-database).
region Changes to this property will trigger replacement. str
region) The region in which the resource exists.
size int
Size of the backup (in bytes).
updated_at str
Updated date (Format ISO 8601).
createdAt String
Creation date (Format ISO 8601).
databaseName Changes to this property will trigger replacement. String
Name of the database of this backup.
expiresAt String

Expiration date (Format ISO 8601).

Important: expires_at cannot be removed after being set.

instanceId Changes to this property will trigger replacement. String

UUID of the Database Instance.

Important: Updates to instance_id will recreate the backup.

instanceName String
Name of the instance of the backup.
name String
Name of the database (e.g. my-database).
region Changes to this property will trigger replacement. String
region) The region in which the resource exists.
size Number
Size of the backup (in bytes).
updatedAt String
Updated date (Format ISO 8601).

Import

Databases can be imported using the {region}/{id}, e.g.

bash

$ pulumi import scaleway:index/databaseBackup:DatabaseBackup mybackup 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.