Skip to content
Start here

Hyperdrive

HyperdriveConfigs

resource cloudflare_hyperdrive_config

required Expand Collapse
account_id: String

Define configurations using a unique string identifier.

name: String

The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.

optional Expand Collapse
integration?: JSON
origin_connection_limit?: Int64

The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.

Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not specified, defaults to 20 for free tier and 60 for paid tier. Certain Cloudflare-managed origins may be permitted a higher limit. Contact Cloudflare if you need a higher limit.

caching?: Attributes
disabled?: Bool
max_age?: Int64
stale_while_revalidate?: Int64
mtls?: Attributes

mTLS configuration for the origin connection. Cannot be used with VPC Service origins; TLS must be managed on the VPC Service.

ca_certificate_id?: String

Define CA certificate ID obtained after uploading CA cert.

mtls_certificate_id?: String

Define mTLS certificate ID obtained after uploading client cert.

sslmode?: String

PostgreSQL accepts require, verify-ca, and verify-full. MySQL accepts REQUIRED, VERIFY_CA, and VERIFY_IDENTITY. The verify modes require a CA certificate; the require modes cannot be used with a CA certificate.

origin?: Attributes

Combines database connection fields with exactly one supported network location.

database: String

Set the name of your origin database.

host?: String

Defines the publicly reachable hostname or IP of your origin database. Private, loopback, and link-local IP addresses are not allowed.

password: String

Set the password needed to access your origin database. The API never returns this write-only value.

port?: Int64

Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.

scheme: String

Specifies the URL scheme used to connect to your origin database.

user: String

Set the user of your origin database.

access_client_id?: String

Defines the Client ID of the Access token to use when connecting to the origin database.

access_client_secret?: String

Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.

service_id?: String

The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.

computed Expand Collapse
id: String

Define configurations using a unique string identifier.

created_on: Time

Defines the creation time of the Hyperdrive configuration.

modified_on: Time

Defines the last modified time of the Hyperdrive configuration.

restarted_on: Time

Defines the last time the Hyperdrive connection pool was explicitly restarted via the restart endpoint. Omitted if the pool has never been explicitly restarted.

cloudflare_hyperdrive_config

resource "cloudflare_hyperdrive_config" "example_hyperdrive_config" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  name = "example-hyperdrive"
  origin = {
    database = "postgres"
    host = "database.example.com"
    password = "password"
    port = 5432
    scheme = "postgres"
    user = "postgres"
  }
  caching = {
    disabled = true
    max_age = 0
    stale_while_revalidate = 0
  }
  integration = {

  }
  mtls = {
    ca_certificate_id = "00000000-0000-0000-0000-0000000000"
    mtls_certificate_id = "00000000-0000-0000-0000-0000000000"
    sslmode = "verify-full"
  }
  origin_connection_limit = 60
}

data cloudflare_hyperdrive_config

required Expand Collapse
hyperdrive_id: String

Define configurations using a unique string identifier.

account_id: String

Define configurations using a unique string identifier.

computed Expand Collapse
id: String

Define configurations using a unique string identifier.

created_on: Time

Defines the creation time of the Hyperdrive configuration.

modified_on: Time

Defines the last modified time of the Hyperdrive configuration.

name: String

The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.

origin_connection_limit: Int64

The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.

Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not specified, defaults to 20 for free tier and 60 for paid tier. Certain Cloudflare-managed origins may be permitted a higher limit. Contact Cloudflare if you need a higher limit.

restarted_on: Time

Defines the last time the Hyperdrive connection pool was explicitly restarted via the restart endpoint. Omitted if the pool has never been explicitly restarted.

caching: Attributes
disabled: Bool

Defines whether caching is disabled.

max_age: Int64

Defines the maximum duration (in seconds) items persist in the cache.

stale_while_revalidate: Int64

Defines the number of seconds the cache may serve a stale response.

integration: Attributes

Connects to a PlanetScale database using credentials managed by Cloudflare. The Cloudflare account must already be linked to PlanetScale in the Hyperdrive dashboard.

database_branch_name: String

The name of the PlanetScale database branch.

database_name: String

The name of the PlanetScale database.

organization_name: String

The name of the PlanetScale organization.

hyperdrive_config_provider: String

The database integration provider used by this operation.

scheme: String

Specifies the URL scheme used to connect to your origin database.

custom_database_name: String

The database name to use when connecting. Defaults to postgres for PostgreSQL and mysql for MySQL.

mtls: Attributes

mTLS configuration for the origin connection. Cannot be used with VPC Service origins; TLS must be managed on the VPC Service.

ca_certificate_id: String

Define CA certificate ID obtained after uploading CA cert.

mtls_certificate_id: String

Define mTLS certificate ID obtained after uploading client cert.

sslmode: String

PostgreSQL accepts require, verify-ca, and verify-full. MySQL accepts REQUIRED, VERIFY_CA, and VERIFY_IDENTITY. The verify modes require a CA certificate; the require modes cannot be used with a CA certificate.

origin: Attributes

Combines database connection fields with exactly one supported network location.

database: String

Set the name of your origin database.

host: String

Defines the publicly reachable hostname or IP of your origin database. Private, loopback, and link-local IP addresses are not allowed.

password: String

Set the password needed to access your origin database. The API never returns this write-only value.

port: Int64

Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.

scheme: String

Specifies the URL scheme used to connect to your origin database.

user: String

Set the user of your origin database.

access_client_id: String

Defines the Client ID of the Access token to use when connecting to the origin database.

access_client_secret: String

Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.

service_id: String

The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.

cloudflare_hyperdrive_config

data "cloudflare_hyperdrive_config" "example_hyperdrive_config" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  hyperdrive_id = "023e105f4ecef8ad9ca31a8372d0c353"
}

data cloudflare_hyperdrive_configs

required Expand Collapse
account_id: String

Define configurations using a unique string identifier.

optional Expand Collapse
max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

Define configurations using a unique string identifier.

caching: Attributes
disabled: Bool

Defines whether caching is disabled.

max_age: Int64

Defines the maximum duration (in seconds) items persist in the cache.

stale_while_revalidate: Int64

Defines the number of seconds the cache may serve a stale response.

name: String

The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.

origin: Attributes

Combines database connection fields with exactly one supported network location.

database: String

Set the name of your origin database.

host: String

Defines the publicly reachable hostname or IP of your origin database. Private, loopback, and link-local IP addresses are not allowed.

password: String

Set the password needed to access your origin database. The API never returns this write-only value.

port: Int64

Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.

scheme: String

Specifies the URL scheme used to connect to your origin database.

user: String

Set the user of your origin database.

access_client_id: String

Defines the Client ID of the Access token to use when connecting to the origin database.

access_client_secret: String

Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.

service_id: String

The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.

created_on: Time

Defines the creation time of the Hyperdrive configuration.

integration: Attributes

Connects to a PlanetScale database using credentials managed by Cloudflare. The Cloudflare account must already be linked to PlanetScale in the Hyperdrive dashboard.

database_branch_name: String

The name of the PlanetScale database branch.

database_name: String

The name of the PlanetScale database.

organization_name: String

The name of the PlanetScale organization.

hyperdrive_config_provider: String

The database integration provider used by this operation.

scheme: String

Specifies the URL scheme used to connect to your origin database.

custom_database_name: String

The database name to use when connecting. Defaults to postgres for PostgreSQL and mysql for MySQL.

modified_on: Time

Defines the last modified time of the Hyperdrive configuration.

mtls: Attributes

mTLS configuration for the origin connection. Cannot be used with VPC Service origins; TLS must be managed on the VPC Service.

ca_certificate_id: String

Define CA certificate ID obtained after uploading CA cert.

mtls_certificate_id: String

Define mTLS certificate ID obtained after uploading client cert.

sslmode: String

PostgreSQL accepts require, verify-ca, and verify-full. MySQL accepts REQUIRED, VERIFY_CA, and VERIFY_IDENTITY. The verify modes require a CA certificate; the require modes cannot be used with a CA certificate.

origin_connection_limit: Int64

The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.

Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts. If not specified, defaults to 20 for free tier and 60 for paid tier. Certain Cloudflare-managed origins may be permitted a higher limit. Contact Cloudflare if you need a higher limit.

restarted_on: Time

Defines the last time the Hyperdrive connection pool was explicitly restarted via the restart endpoint. Omitted if the pool has never been explicitly restarted.

cloudflare_hyperdrive_configs

data "cloudflare_hyperdrive_configs" "example_hyperdrive_configs" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
}