1. Packages
  2. Scaleway
  3. API Docs
  4. getDatabaseBackup
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

scaleway.getDatabaseBackup

Explore with Pulumi AI

scaleway logo
Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse

    Gets information about an RDB backup.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumi/scaleway";
    
    const findByName = scaleway.getDatabaseBackup({
        name: "mybackup",
    });
    const findByNameAndInstance = scaleway.getDatabaseBackup({
        name: "mybackup",
        instanceId: "11111111-1111-1111-1111-111111111111",
    });
    const findById = scaleway.getDatabaseBackup({
        backupId: "11111111-1111-1111-1111-111111111111",
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    find_by_name = scaleway.get_database_backup(name="mybackup")
    find_by_name_and_instance = scaleway.get_database_backup(name="mybackup",
        instance_id="11111111-1111-1111-1111-111111111111")
    find_by_id = scaleway.get_database_backup(backup_id="11111111-1111-1111-1111-111111111111")
    
    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.LookupDatabaseBackup(ctx, &scaleway.LookupDatabaseBackupArgs{
    			Name: pulumi.StringRef("mybackup"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.LookupDatabaseBackup(ctx, &scaleway.LookupDatabaseBackupArgs{
    			Name:       pulumi.StringRef("mybackup"),
    			InstanceId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = scaleway.LookupDatabaseBackup(ctx, &scaleway.LookupDatabaseBackupArgs{
    			BackupId: pulumi.StringRef("11111111-1111-1111-1111-111111111111"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        var findByName = Scaleway.GetDatabaseBackup.Invoke(new()
        {
            Name = "mybackup",
        });
    
        var findByNameAndInstance = Scaleway.GetDatabaseBackup.Invoke(new()
        {
            Name = "mybackup",
            InstanceId = "11111111-1111-1111-1111-111111111111",
        });
    
        var findById = Scaleway.GetDatabaseBackup.Invoke(new()
        {
            BackupId = "11111111-1111-1111-1111-111111111111",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.ScalewayFunctions;
    import com.pulumi.scaleway.inputs.GetDatabaseBackupArgs;
    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) {
            final var findByName = ScalewayFunctions.getDatabaseBackup(GetDatabaseBackupArgs.builder()
                .name("mybackup")
                .build());
    
            final var findByNameAndInstance = ScalewayFunctions.getDatabaseBackup(GetDatabaseBackupArgs.builder()
                .name("mybackup")
                .instanceId("11111111-1111-1111-1111-111111111111")
                .build());
    
            final var findById = ScalewayFunctions.getDatabaseBackup(GetDatabaseBackupArgs.builder()
                .backupId("11111111-1111-1111-1111-111111111111")
                .build());
    
        }
    }
    
    variables:
      findByName:
        fn::invoke:
          Function: scaleway:getDatabaseBackup
          Arguments:
            name: mybackup
      findByNameAndInstance:
        fn::invoke:
          Function: scaleway:getDatabaseBackup
          Arguments:
            name: mybackup
            instanceId: 11111111-1111-1111-1111-111111111111
      findById:
        fn::invoke:
          Function: scaleway:getDatabaseBackup
          Arguments:
            backupId: 11111111-1111-1111-1111-111111111111
    

    Using getDatabaseBackup

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDatabaseBackup(args: GetDatabaseBackupArgs, opts?: InvokeOptions): Promise<GetDatabaseBackupResult>
    function getDatabaseBackupOutput(args: GetDatabaseBackupOutputArgs, opts?: InvokeOptions): Output<GetDatabaseBackupResult>
    def get_database_backup(backup_id: Optional[str] = None,
                            instance_id: Optional[str] = None,
                            name: Optional[str] = None,
                            project_id: Optional[str] = None,
                            region: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetDatabaseBackupResult
    def get_database_backup_output(backup_id: Optional[pulumi.Input[str]] = None,
                            instance_id: Optional[pulumi.Input[str]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            project_id: Optional[pulumi.Input[str]] = None,
                            region: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseBackupResult]
    func LookupDatabaseBackup(ctx *Context, args *LookupDatabaseBackupArgs, opts ...InvokeOption) (*LookupDatabaseBackupResult, error)
    func LookupDatabaseBackupOutput(ctx *Context, args *LookupDatabaseBackupOutputArgs, opts ...InvokeOption) LookupDatabaseBackupResultOutput

    > Note: This function is named LookupDatabaseBackup in the Go SDK.

    public static class GetDatabaseBackup 
    {
        public static Task<GetDatabaseBackupResult> InvokeAsync(GetDatabaseBackupArgs args, InvokeOptions? opts = null)
        public static Output<GetDatabaseBackupResult> Invoke(GetDatabaseBackupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDatabaseBackupResult> getDatabaseBackup(GetDatabaseBackupArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: scaleway:index/getDatabaseBackup:getDatabaseBackup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    BackupId string
    The backup ID.
    InstanceId string
    The Database Instance ID.
    Name string

    The name of the RDB instance.

    Note You must specify at least one: name and/or backup_id.

    ProjectId string
    The ID of the project the Database Backup is associated with.
    Region string
    region) The region in which the Database Backup is associated with.
    BackupId string
    The backup ID.
    InstanceId string
    The Database Instance ID.
    Name string

    The name of the RDB instance.

    Note You must specify at least one: name and/or backup_id.

    ProjectId string
    The ID of the project the Database Backup is associated with.
    Region string
    region) The region in which the Database Backup is associated with.
    backupId String
    The backup ID.
    instanceId String
    The Database Instance ID.
    name String

    The name of the RDB instance.

    Note You must specify at least one: name and/or backup_id.

    projectId String
    The ID of the project the Database Backup is associated with.
    region String
    region) The region in which the Database Backup is associated with.
    backupId string
    The backup ID.
    instanceId string
    The Database Instance ID.
    name string

    The name of the RDB instance.

    Note You must specify at least one: name and/or backup_id.

    projectId string
    The ID of the project the Database Backup is associated with.
    region string
    region) The region in which the Database Backup is associated with.
    backup_id str
    The backup ID.
    instance_id str
    The Database Instance ID.
    name str

    The name of the RDB instance.

    Note You must specify at least one: name and/or backup_id.

    project_id str
    The ID of the project the Database Backup is associated with.
    region str
    region) The region in which the Database Backup is associated with.
    backupId String
    The backup ID.
    instanceId String
    The Database Instance ID.
    name String

    The name of the RDB instance.

    Note You must specify at least one: name and/or backup_id.

    projectId String
    The ID of the project the Database Backup is associated with.
    region String
    region) The region in which the Database Backup is associated with.

    getDatabaseBackup Result

    The following output properties are available:

    CreatedAt string
    DatabaseName string
    ExpiresAt string
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceName string
    Size int
    UpdatedAt string
    BackupId string
    InstanceId string
    Name string
    ProjectId string
    Region string
    CreatedAt string
    DatabaseName string
    ExpiresAt string
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceName string
    Size int
    UpdatedAt string
    BackupId string
    InstanceId string
    Name string
    ProjectId string
    Region string
    createdAt String
    databaseName String
    expiresAt String
    id String
    The provider-assigned unique ID for this managed resource.
    instanceName String
    size Integer
    updatedAt String
    backupId String
    instanceId String
    name String
    projectId String
    region String
    createdAt string
    databaseName string
    expiresAt string
    id string
    The provider-assigned unique ID for this managed resource.
    instanceName string
    size number
    updatedAt string
    backupId string
    instanceId string
    name string
    projectId string
    region string
    created_at str
    database_name str
    expires_at str
    id str
    The provider-assigned unique ID for this managed resource.
    instance_name str
    size int
    updated_at str
    backup_id str
    instance_id str
    name str
    project_id str
    region str
    createdAt String
    databaseName String
    expiresAt String
    id String
    The provider-assigned unique ID for this managed resource.
    instanceName String
    size Number
    updatedAt String
    backupId String
    instanceId String
    name String
    projectId String
    region String

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.20.0 published on Monday, Nov 4, 2024 by pulumiverse