D1Database

class D1Database : KotlinCustomResource

!> When a D1 Database is replaced all the data is lost. Please ensure you have a backup of your data before replacing a D1 Database.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
const exampleD1Database = new cloudflare.D1Database("example_d1_database", {
accountId: "023e105f4ecef8ad9ca31a8372d0c353",
name: "my-database",
primaryLocationHint: "wnam",
});
import pulumi
import pulumi_cloudflare as cloudflare
example_d1_database = cloudflare.D1Database("example_d1_database",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
name="my-database",
primary_location_hint="wnam")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
var exampleD1Database = new Cloudflare.D1Database("example_d1_database", new()
{
AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
Name = "my-database",
PrimaryLocationHint = "wnam",
});
});
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.NewD1Database(ctx, "example_d1_database", &cloudflare.D1DatabaseArgs{
AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
Name: pulumi.String("my-database"),
PrimaryLocationHint: pulumi.String("wnam"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.D1Database;
import com.pulumi.cloudflare.D1DatabaseArgs;
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 exampleD1Database = new D1Database("exampleD1Database", D1DatabaseArgs.builder()
.accountId("023e105f4ecef8ad9ca31a8372d0c353")
.name("my-database")
.primaryLocationHint("wnam")
.build());
}
}
resources:
exampleD1Database:
type: cloudflare:D1Database
name: example_d1_database
properties:
accountId: 023e105f4ecef8ad9ca31a8372d0c353
name: my-database
primaryLocationHint: wnam

Import

$ pulumi import cloudflare:index/d1Database:D1Database example '<account_id>/<database_id>'

Properties

Link copied to clipboard
val accountId: Output<String>

Account identifier tag.

Link copied to clipboard
val createdAt: Output<String>

Specifies the timestamp the resource was created as an ISO8601 string.

Link copied to clipboard
val fileSize: Output<Double>

The D1 database's size, in bytes.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

D1 database name.

Link copied to clipboard
val numTables: Output<Double>
Link copied to clipboard

Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user. Available values: "wnam", "enam", "weur", "eeur", "apac", "oc".

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val uuid: Output<String>

D1 database identifier (UUID).

Link copied to clipboard
val version: Output<String>