Skip to content
Start here

D1

D1Database

resource cloudflare_d1_database

required Expand Collapse
account_id: String

Account identifier tag.

name: String

D1 database name.

optional Expand Collapse
jurisdiction?: String

Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.

primary_location_hint?: String

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.

read_replication?: Attributes

Configuration for D1 read replication.

mode: String

The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).

computed Expand Collapse
id: String

D1 database identifier (UUID).

uuid: String

D1 database identifier (UUID).

created_at: Time

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

file_size: Float64

The D1 database's size, in bytes.

num_tables: Float64
version: String

cloudflare_d1_database

resource "cloudflare_d1_database" "example_d1_database" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  name = "my-database"
  jurisdiction = "eu"
  primary_location_hint = "wnam"
}

data cloudflare_d1_database

required Expand Collapse
account_id: String

Account identifier tag.

optional Expand Collapse
database_id?: String

D1 database identifier (UUID).

filter?: Attributes
name?: String

a database name to search for.

computed Expand Collapse
id: String

D1 database identifier (UUID).

created_at: Time

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

file_size: Float64

The D1 database's size, in bytes.

jurisdiction: String

Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.

name: String

D1 database name.

num_tables: Float64
uuid: String

D1 database identifier (UUID).

version: String
read_replication: Attributes

Configuration for D1 read replication.

mode: String

The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).

cloudflare_d1_database

data "cloudflare_d1_database" "example_d1_database" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

data cloudflare_d1_databases

required Expand Collapse
account_id: String

Account identifier tag.

optional Expand Collapse
name?: String

a database name to search for.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

D1 database identifier (UUID).

created_at: Time

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

jurisdiction: String

Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.

name: String

D1 database name.

uuid: String

D1 database identifier (UUID).

version: String

cloudflare_d1_databases

data "cloudflare_d1_databases" "example_d1_databases" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  name = "name"
}