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

scaleway.getDatabase

Explore with Pulumi AI

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

    Gets information about a database.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumi/scaleway";
    
    // Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
    const myDb = scaleway.getDatabase({
        instanceId: "11111111-1111-1111-1111-111111111111",
        name: "foobar",
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    
    # Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
    my_db = scaleway.get_database(instance_id="11111111-1111-1111-1111-111111111111",
        name="foobar")
    
    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 {
    		// Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
    		_, err := scaleway.LookupDatabase(ctx, &scaleway.LookupDatabaseArgs{
    			InstanceId: "11111111-1111-1111-1111-111111111111",
    			Name:       "foobar",
    		}, 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(() => 
    {
        // Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
        var myDb = Scaleway.GetDatabase.Invoke(new()
        {
            InstanceId = "11111111-1111-1111-1111-111111111111",
            Name = "foobar",
        });
    
    });
    
    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.GetDatabaseArgs;
    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) {
            // Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
            final var myDb = ScalewayFunctions.getDatabase(GetDatabaseArgs.builder()
                .instanceId("11111111-1111-1111-1111-111111111111")
                .name("foobar")
                .build());
    
        }
    }
    
    variables:
      # Get the database foobar hosted on instance id 11111111-1111-1111-1111-111111111111
      myDb:
        fn::invoke:
          Function: scaleway:getDatabase
          Arguments:
            instanceId: 11111111-1111-1111-1111-111111111111
            name: foobar
    

    Using getDatabase

    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 getDatabase(args: GetDatabaseArgs, opts?: InvokeOptions): Promise<GetDatabaseResult>
    function getDatabaseOutput(args: GetDatabaseOutputArgs, opts?: InvokeOptions): Output<GetDatabaseResult>
    def get_database(instance_id: Optional[str] = None,
                     name: Optional[str] = None,
                     region: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetDatabaseResult
    def get_database_output(instance_id: Optional[pulumi.Input[str]] = None,
                     name: Optional[pulumi.Input[str]] = None,
                     region: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseResult]
    func LookupDatabase(ctx *Context, args *LookupDatabaseArgs, opts ...InvokeOption) (*LookupDatabaseResult, error)
    func LookupDatabaseOutput(ctx *Context, args *LookupDatabaseOutputArgs, opts ...InvokeOption) LookupDatabaseResultOutput

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

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

    The following arguments are supported:

    InstanceId string
    The RDB instance ID.
    Name string
    The name of the RDB instance.
    Region string
    InstanceId string
    The RDB instance ID.
    Name string
    The name of the RDB instance.
    Region string
    instanceId String
    The RDB instance ID.
    name String
    The name of the RDB instance.
    region String
    instanceId string
    The RDB instance ID.
    name string
    The name of the RDB instance.
    region string
    instance_id str
    The RDB instance ID.
    name str
    The name of the RDB instance.
    region str
    instanceId String
    The RDB instance ID.
    name String
    The name of the RDB instance.
    region String

    getDatabase Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceId string
    Managed bool
    Whether the database is managed or not.
    Name string
    Owner string
    The name of the owner of the database.
    Size string
    Size of the database (in bytes).
    Region string
    Id string
    The provider-assigned unique ID for this managed resource.
    InstanceId string
    Managed bool
    Whether the database is managed or not.
    Name string
    Owner string
    The name of the owner of the database.
    Size string
    Size of the database (in bytes).
    Region string
    id String
    The provider-assigned unique ID for this managed resource.
    instanceId String
    managed Boolean
    Whether the database is managed or not.
    name String
    owner String
    The name of the owner of the database.
    size String
    Size of the database (in bytes).
    region String
    id string
    The provider-assigned unique ID for this managed resource.
    instanceId string
    managed boolean
    Whether the database is managed or not.
    name string
    owner string
    The name of the owner of the database.
    size string
    Size of the database (in bytes).
    region string
    id str
    The provider-assigned unique ID for this managed resource.
    instance_id str
    managed bool
    Whether the database is managed or not.
    name str
    owner str
    The name of the owner of the database.
    size str
    Size of the database (in bytes).
    region str
    id String
    The provider-assigned unique ID for this managed resource.
    instanceId String
    managed Boolean
    Whether the database is managed or not.
    name String
    owner String
    The name of the owner of the database.
    size String
    Size of the database (in bytes).
    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