1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. getD1Database
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.getD1Database

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleD1Database = cloudflare.getD1Database({
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        databaseId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_d1_database = cloudflare.get_d1_database(account_id="023e105f4ecef8ad9ca31a8372d0c353",
        database_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.LookupD1Database(ctx, &cloudflare.LookupD1DatabaseArgs{
    			AccountId:  "023e105f4ecef8ad9ca31a8372d0c353",
    			DatabaseId: pulumi.StringRef("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleD1Database = Cloudflare.GetD1Database.Invoke(new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            DatabaseId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CloudflareFunctions;
    import com.pulumi.cloudflare.inputs.GetD1DatabaseArgs;
    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 exampleD1Database = CloudflareFunctions.getD1Database(GetD1DatabaseArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .databaseId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
                .build());
    
        }
    }
    
    variables:
      exampleD1Database:
        fn::invoke:
          function: cloudflare:getD1Database
          arguments:
            accountId: 023e105f4ecef8ad9ca31a8372d0c353
            databaseId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    

    Using getD1Database

    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 getD1Database(args: GetD1DatabaseArgs, opts?: InvokeOptions): Promise<GetD1DatabaseResult>
    function getD1DatabaseOutput(args: GetD1DatabaseOutputArgs, opts?: InvokeOptions): Output<GetD1DatabaseResult>
    def get_d1_database(account_id: Optional[str] = None,
                        database_id: Optional[str] = None,
                        filter: Optional[GetD1DatabaseFilter] = None,
                        opts: Optional[InvokeOptions] = None) -> GetD1DatabaseResult
    def get_d1_database_output(account_id: Optional[pulumi.Input[str]] = None,
                        database_id: Optional[pulumi.Input[str]] = None,
                        filter: Optional[pulumi.Input[GetD1DatabaseFilterArgs]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetD1DatabaseResult]
    func LookupD1Database(ctx *Context, args *LookupD1DatabaseArgs, opts ...InvokeOption) (*LookupD1DatabaseResult, error)
    func LookupD1DatabaseOutput(ctx *Context, args *LookupD1DatabaseOutputArgs, opts ...InvokeOption) LookupD1DatabaseResultOutput

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

    public static class GetD1Database 
    {
        public static Task<GetD1DatabaseResult> InvokeAsync(GetD1DatabaseArgs args, InvokeOptions? opts = null)
        public static Output<GetD1DatabaseResult> Invoke(GetD1DatabaseInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetD1DatabaseResult> getD1Database(GetD1DatabaseArgs args, InvokeOptions options)
    public static Output<GetD1DatabaseResult> getD1Database(GetD1DatabaseArgs args, InvokeOptions options)
    
    fn::invoke:
      function: cloudflare:index/getD1Database:getD1Database
      arguments:
        # arguments dictionary

    The following arguments are supported:

    AccountId string
    Account identifier tag.
    DatabaseId string
    D1 database identifier (UUID).
    Filter GetD1DatabaseFilter
    AccountId string
    Account identifier tag.
    DatabaseId string
    D1 database identifier (UUID).
    Filter GetD1DatabaseFilter
    accountId String
    Account identifier tag.
    databaseId String
    D1 database identifier (UUID).
    filter GetD1DatabaseFilter
    accountId string
    Account identifier tag.
    databaseId string
    D1 database identifier (UUID).
    filter GetD1DatabaseFilter
    account_id str
    Account identifier tag.
    database_id str
    D1 database identifier (UUID).
    filter GetD1DatabaseFilter
    accountId String
    Account identifier tag.
    databaseId String
    D1 database identifier (UUID).
    filter Property Map

    getD1Database Result

    The following output properties are available:

    AccountId string
    Account identifier tag.
    CreatedAt string
    Specifies the timestamp the resource was created as an ISO8601 string.
    FileSize double
    The D1 database's size, in bytes.
    Id string
    D1 database identifier (UUID).
    Name string
    D1 database name.
    NumTables double
    Uuid string
    D1 database identifier (UUID).
    Version string
    DatabaseId string
    D1 database identifier (UUID).
    Filter GetD1DatabaseFilter
    AccountId string
    Account identifier tag.
    CreatedAt string
    Specifies the timestamp the resource was created as an ISO8601 string.
    FileSize float64
    The D1 database's size, in bytes.
    Id string
    D1 database identifier (UUID).
    Name string
    D1 database name.
    NumTables float64
    Uuid string
    D1 database identifier (UUID).
    Version string
    DatabaseId string
    D1 database identifier (UUID).
    Filter GetD1DatabaseFilter
    accountId String
    Account identifier tag.
    createdAt String
    Specifies the timestamp the resource was created as an ISO8601 string.
    fileSize Double
    The D1 database's size, in bytes.
    id String
    D1 database identifier (UUID).
    name String
    D1 database name.
    numTables Double
    uuid String
    D1 database identifier (UUID).
    version String
    databaseId String
    D1 database identifier (UUID).
    filter GetD1DatabaseFilter
    accountId string
    Account identifier tag.
    createdAt string
    Specifies the timestamp the resource was created as an ISO8601 string.
    fileSize number
    The D1 database's size, in bytes.
    id string
    D1 database identifier (UUID).
    name string
    D1 database name.
    numTables number
    uuid string
    D1 database identifier (UUID).
    version string
    databaseId string
    D1 database identifier (UUID).
    filter GetD1DatabaseFilter
    account_id str
    Account identifier tag.
    created_at str
    Specifies the timestamp the resource was created as an ISO8601 string.
    file_size float
    The D1 database's size, in bytes.
    id str
    D1 database identifier (UUID).
    name str
    D1 database name.
    num_tables float
    uuid str
    D1 database identifier (UUID).
    version str
    database_id str
    D1 database identifier (UUID).
    filter GetD1DatabaseFilter
    accountId String
    Account identifier tag.
    createdAt String
    Specifies the timestamp the resource was created as an ISO8601 string.
    fileSize Number
    The D1 database's size, in bytes.
    id String
    D1 database identifier (UUID).
    name String
    D1 database name.
    numTables Number
    uuid String
    D1 database identifier (UUID).
    version String
    databaseId String
    D1 database identifier (UUID).
    filter Property Map

    Supporting Types

    GetD1DatabaseFilter

    Name string
    a database name to search for.
    Name string
    a database name to search for.
    name String
    a database name to search for.
    name string
    a database name to search for.
    name str
    a database name to search for.
    name String
    a database name to search for.

    Package Details

    Repository
    Cloudflare pulumi/pulumi-cloudflare
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cloudflare Terraform Provider.
    cloudflare logo
    Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi