---
title: D1
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/terraform)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# D1

#### D1Database

#### resource cloudflare\_d1\_database

##### required Expand Collapse

account\_id: String

Account identifier tag.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20account_id>)

name: String

D1 database name.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20name>)

##### 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.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20jurisdiction>)

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.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20primary_location_hint>)

<details>

<summary>

read\_replication?: Attributes

Configuration for D1 read replication.

</summary>

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).

<a href="#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20read_replication%20%3E%20(attribute)%20mode">Link to this property</a>

</details>

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20read_replication>)

##### computed Expand Collapse

id: String

D1 database identifier (UUID).

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

uuid: String

D1 database identifier (UUID).

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20uuid>)

created\_at: Time

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

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20created_at>)

file\_size: Float64

The D1 database’s size, in bytes.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20file_size>)

Deprecatednum\_tables: Float64

The number of tables in the D1 database. This count is no longer accurate and should not be relied upon.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20num_tables>)

version: String

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20version>)

### cloudflare\_d1\_database

Terraform

HTTPTypeScriptPythonGoTerraform

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

#### data cloudflare\_d1\_database

##### required Expand Collapse

account\_id: String

Account identifier tag.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20account_id>)

##### optional Expand Collapse

database\_id?: String

D1 database identifier (UUID).

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20database_id>)

fields?: List\[String]

Comma-separated list of fields to include in the response. When omitted, all fields are returned.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20fields>)

<details>

<summary>

filter?: Attributes

</summary>

name?: String

a database name to search for.

<a href="#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter%20%3E%20(attribute)%20name">Link to this property</a>

</details>

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20filter>)

##### computed Expand Collapse

id: String

D1 database identifier (UUID).

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

created\_at: Time

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

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20created_at>)

file\_size: Float64

The D1 database’s size, in bytes.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20file_size>)

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.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20jurisdiction>)

name: String

D1 database name.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20name>)

Deprecatednum\_tables: Float64

The number of tables in the D1 database. This count is no longer accurate and should not be relied upon.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20num_tables>)

uuid: String

D1 database identifier (UUID).

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20uuid>)

version: String

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20version>)

<details>

<summary>

read\_replication: Attributes

Configuration for D1 read replication.

</summary>

mode: String

The read replication mode for the database. Mode ‘auto’ denotes that D1 creates replicas and automatically places them around the world. Mode ‘disabled’ denotes that no database replicas are used.

<a href="#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20read_replication%20%3E%20(attribute)%20mode">Link to this property</a>

</details>

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20read_replication>)

### cloudflare\_d1\_database

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_d1_database" "example_d1_database" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  fields = ["uuid"]
}
```

#### data cloudflare\_d1\_databases

##### required Expand Collapse

account\_id: String

Account identifier tag.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20account_id>)

##### optional Expand Collapse

name?: String

a database name to search for.

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20name>)

max\_items?: Int64

Max items to fetch, default: 1000

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20max_items>)

##### computed Expand Collapse

<details>

<summary>

result: List\[Attributes]

The items returned by the data source

</summary>

id: String

D1 database identifier (UUID).

<a href="#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20id">Link to this property</a>

created\_at: Time

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

<a href="#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20created_at">Link to this property</a>

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.

<a href="#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20jurisdiction">Link to this property</a>

name: String

D1 database name.

<a href="#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20name">Link to this property</a>

uuid: String

D1 database identifier (UUID).

<a href="#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20uuid">Link to this property</a>

version: String

<a href="#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20version">Link to this property</a>

</details>

[Link to this property](<#(resource)%20d1.database%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result>)

### cloudflare\_d1\_databases

Terraform

HTTPTypeScriptPythonGoTerraform

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