---
title: Create Hyperdrive
---

[Skip to content](#_top)

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

[Hyperdrive](https://developers.cloudflare.com/api/go/resources/hyperdrive)

[Configs](https://developers.cloudflare.com/api/go/resources/hyperdrive/subresources/configs)

Copy Markdown

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

---

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

# Create Hyperdrive

client.Hyperdrive.Configs.New(ctx, params) (\*[ConfigNewResponse](<https://developers.cloudflare.com/api/go/resources/hyperdrive#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/hyperdrive/configs

Creates and returns a new Hyperdrive configuration. For a PlanetScale integration, the Cloudflare account must already be linked to PlanetScale in the Hyperdrive dashboard.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**<code>X-Auth-Email: user@example.com</code>

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Hyperdrive Write`

##### ParametersExpand Collapse

<details>

<summary>

params ConfigNewParams

</summary>

AccountID param.Field\[string]

Path param: Define configurations using a unique string identifier.

maxLength32

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20account_id">Link to this property</a>

Name param.Field\[string]

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

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20name">Link to this property</a>

<details>

<summary>

Origin param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/hyperdrive/subresources/configs/methods/create#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)">ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOrigin</a>]

Body param: Combines database connection fields with exactly one supported network location.

</summary>

<details>

<summary>

ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabase

</summary>

Database string

Set the name of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20database">Link to this property</a>

Host string

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20host">Link to this property</a>

Password string

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

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20password">Link to this property</a>

Port int64

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

maximum65535

minimum1

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20port">Link to this property</a>

<details>

<summary>

Scheme ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabaseScheme

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

</summary>

One of the following:

const ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabaseSchemePostgres ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabaseScheme = "postgres"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20scheme%20%3E%20(member)%200">Link to this property</a>

const ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabaseSchemePostgresql ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabaseScheme = "postgresql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20scheme%20%3E%20(member)%201">Link to this property</a>

const ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabaseSchemeMysql ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabaseScheme = "mysql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20scheme%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20scheme">Link to this property</a>

User string

Set the user of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20user">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginAccessProtectedDatabaseBehindCloudflareTunnel

</summary>

AccessClientID string

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20access_client_id">Link to this property</a>

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20access_client_secret">Link to this property</a>

Database string

Set the name of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20database">Link to this property</a>

Host string

Defines the host (hostname or IP) of your origin database.

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20host">Link to this property</a>

Password string

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

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20password">Link to this property</a>

<details>

<summary>

Scheme ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme

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

</summary>

One of the following:

const ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemePostgres ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "postgres"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20scheme%20%3E%20(member)%200">Link to this property</a>

const ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemePostgresql ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "postgresql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20scheme%20%3E%20(member)%201">Link to this property</a>

const ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemeMysql ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "mysql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20scheme%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20scheme">Link to this property</a>

User string

Set the user of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20user">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%201">Link to this property</a>

<details>

<summary>

ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginDatabaseReachableThroughAWorkersVPC

</summary>

Database string

Set the name of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20database">Link to this property</a>

Password string

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

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20password">Link to this property</a>

<details>

<summary>

Scheme ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginDatabaseReachableThroughAWorkersVPCScheme

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

</summary>

One of the following:

const ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginDatabaseReachableThroughAWorkersVPCSchemePostgres ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginDatabaseReachableThroughAWorkersVPCScheme = "postgres"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20scheme%20%3E%20(member)%200">Link to this property</a>

const ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginDatabaseReachableThroughAWorkersVPCSchemePostgresql ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginDatabaseReachableThroughAWorkersVPCScheme = "postgresql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20scheme%20%3E%20(member)%201">Link to this property</a>

const ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginDatabaseReachableThroughAWorkersVPCSchemeMysql ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginOriginDatabaseReachableThroughAWorkersVPCScheme = "mysql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20scheme%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20scheme">Link to this property</a>

ServiceID string

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20service_id">Link to this property</a>

User string

Set the user of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%202%20%3E%20(property)%20user">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin%20%3E%20(schema)%20%3E%20(variant)%202">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin">Link to this property</a>

<details>

<summary>

Caching param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/hyperdrive/subresources/configs/methods/create#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching%20%3E%20(schema)">ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginCaching</a>]Optional

Body param

</summary>

<details>

<summary>

ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginCachingHyperdriveHyperdriveCachingCreateDisabled

</summary>

Disabled ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginCachingHyperdriveHyperdriveCachingCreateDisabledDisabled

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20disabled">Link to this property</a>

MaxAge int64Optional

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20max_age">Link to this property</a>

StaleWhileRevalidate int64Optional

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(property)%20stale_while_revalidate">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching%20%3E%20(schema)%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginCachingHyperdriveHyperdriveCachingCreateEnabled

</summary>

Disabled ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginCachingHyperdriveHyperdriveCachingCreateEnabledDisabledOptional

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20disabled">Link to this property</a>

MaxAge int64Optional

Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.

maximum3600

minimum1

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20max_age">Link to this property</a>

StaleWhileRevalidate int64Optional

Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.

minimum0

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching%20%3E%20(schema)%20%3E%20(variant)%201%20%3E%20(property)%20stale_while_revalidate">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching%20%3E%20(schema)%20%3E%20(variant)%201">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20caching">Link to this property</a>

Integration param.Field\[unknown]Optional

Body param

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20integration">Link to this property</a>

<details>

<summary>

MTLS param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/hyperdrive/subresources/configs/methods/create#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20mtls%20%3E%20(schema)">ConfigNewParamsHyperdriveHyperdriveConfigCreateWithOriginMTLS</a>]Optional

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

</summary>

CACertificateID stringOptional

Define CA certificate ID obtained after uploading CA cert.

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20mtls%20%3E%20(schema)%20%3E%20(property)%20ca_certificate_id">Link to this property</a>

MTLSCertificateID stringOptional

Define mTLS certificate ID obtained after uploading client cert.

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20mtls%20%3E%20(schema)%20%3E%20(property)%20mtls_certificate_id">Link to this property</a>

Sslmode stringOptional

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20mtls%20%3E%20(schema)%20%3E%20(property)%20sslmode">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20mtls">Link to this property</a>

OriginConnectionLimit param.Field\[int64]Optional

Body param: 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.

minimum5

<a href="#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200%20%3E%20(param)%20origin_connection_limit">Link to this property</a>

</details>

[Link to this property](<#(resource)%20hyperdrive.configs%20%3E%20(method)%20create%20%3E%20(params)%200>)

##### ReturnsExpand Collapse

<details>

<summary>

type ConfigNewResponse struct{…}

</summary>

ID string

Define configurations using a unique string identifier.

maxLength32

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

Caching ConfigNewResponseCaching

</summary>

Disabled bool

Defines whether caching is disabled.

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20caching%20%3E%20(property)%20disabled">Link to this property</a>

MaxAge int64Optional

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

maximum3600

minimum1

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20caching%20%3E%20(property)%20max_age">Link to this property</a>

StaleWhileRevalidate int64Optional

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

minimum0

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20caching%20%3E%20(property)%20stale_while_revalidate">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20caching">Link to this property</a>

Name string

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

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

<details>

<summary>

Origin ConfigNewResponseOrigin

Combines database connection fields with exactly one supported network location.

</summary>

One of the following:

<details>

<summary>

type ConfigNewResponseOriginPublicDatabase struct{…}

</summary>

Database string

Set the name of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200%20%3E%20(property)%20database">Link to this property</a>

Host string

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200%20%3E%20(property)%20host">Link to this property</a>

Password string

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

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200%20%3E%20(property)%20password">Link to this property</a>

Port int64

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

maximum65535

minimum1

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200%20%3E%20(property)%20port">Link to this property</a>

<details>

<summary>

Scheme ConfigNewResponseOriginPublicDatabaseScheme

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

</summary>

One of the following:

const ConfigNewResponseOriginPublicDatabaseSchemePostgres ConfigNewResponseOriginPublicDatabaseScheme = "postgres"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200%20%3E%20(property)%20scheme%20%3E%20(member)%200">Link to this property</a>

const ConfigNewResponseOriginPublicDatabaseSchemePostgresql ConfigNewResponseOriginPublicDatabaseScheme = "postgresql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200%20%3E%20(property)%20scheme%20%3E%20(member)%201">Link to this property</a>

const ConfigNewResponseOriginPublicDatabaseSchemeMysql ConfigNewResponseOriginPublicDatabaseScheme = "mysql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200%20%3E%20(property)%20scheme%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200%20%3E%20(property)%20scheme">Link to this property</a>

User string

Set the user of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200%20%3E%20(property)%20user">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%200">Link to this property</a>

<details>

<summary>

type ConfigNewResponseOriginAccessProtectedDatabaseBehindCloudflareTunnel struct{…}

</summary>

AccessClientID string

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20access_client_id">Link to this property</a>

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20access_client_secret">Link to this property</a>

Database string

Set the name of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20database">Link to this property</a>

Host string

Defines the host (hostname or IP) of your origin database.

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20host">Link to this property</a>

Password string

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

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20password">Link to this property</a>

<details>

<summary>

Scheme ConfigNewResponseOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme

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

</summary>

One of the following:

const ConfigNewResponseOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemePostgres ConfigNewResponseOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "postgres"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20scheme%20%3E%20(member)%200">Link to this property</a>

const ConfigNewResponseOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemePostgresql ConfigNewResponseOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "postgresql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20scheme%20%3E%20(member)%201">Link to this property</a>

const ConfigNewResponseOriginAccessProtectedDatabaseBehindCloudflareTunnelSchemeMysql ConfigNewResponseOriginAccessProtectedDatabaseBehindCloudflareTunnelScheme = "mysql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20scheme%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20scheme">Link to this property</a>

User string

Set the user of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201%20%3E%20(property)%20user">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%201">Link to this property</a>

<details>

<summary>

type ConfigNewResponseOriginDatabaseReachableThroughAWorkersVPC struct{…}

</summary>

Database string

Set the name of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%202%20%3E%20(property)%20database">Link to this property</a>

Password string

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

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%202%20%3E%20(property)%20password">Link to this property</a>

<details>

<summary>

Scheme ConfigNewResponseOriginDatabaseReachableThroughAWorkersVPCScheme

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

</summary>

One of the following:

const ConfigNewResponseOriginDatabaseReachableThroughAWorkersVPCSchemePostgres ConfigNewResponseOriginDatabaseReachableThroughAWorkersVPCScheme = "postgres"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%202%20%3E%20(property)%20scheme%20%3E%20(member)%200">Link to this property</a>

const ConfigNewResponseOriginDatabaseReachableThroughAWorkersVPCSchemePostgresql ConfigNewResponseOriginDatabaseReachableThroughAWorkersVPCScheme = "postgresql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%202%20%3E%20(property)%20scheme%20%3E%20(member)%201">Link to this property</a>

const ConfigNewResponseOriginDatabaseReachableThroughAWorkersVPCSchemeMysql ConfigNewResponseOriginDatabaseReachableThroughAWorkersVPCScheme = "mysql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%202%20%3E%20(property)%20scheme%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%202%20%3E%20(property)%20scheme">Link to this property</a>

ServiceID string

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%202%20%3E%20(property)%20service_id">Link to this property</a>

User string

Set the user of your origin database.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%202%20%3E%20(property)%20user">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin%20%3E%20(variant)%202">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin">Link to this property</a>

CreatedOn TimeOptional

Defines the creation time of the Hyperdrive configuration.

formatdate-time

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20created_on">Link to this property</a>

<details>

<summary>

Integration ConfigNewResponseIntegrationOptional

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

</summary>

DatabaseBranchName string

The name of the PlanetScale database branch.

maxLength2048

minLength1

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration%20%3E%20(property)%20database_branch_name">Link to this property</a>

DatabaseName string

The name of the PlanetScale database.

maxLength2048

minLength1

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration%20%3E%20(property)%20database_name">Link to this property</a>

OrganizationName string

The name of the PlanetScale organization.

maxLength2048

minLength1

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration%20%3E%20(property)%20organization_name">Link to this property</a>

Provider ConfigNewResponseIntegrationProvider

The database integration provider used by this operation.

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration%20%3E%20(property)%20provider">Link to this property</a>

<details>

<summary>

Scheme ConfigNewResponseIntegrationScheme

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

</summary>

One of the following:

const ConfigNewResponseIntegrationSchemePostgres ConfigNewResponseIntegrationScheme = "postgres"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration%20%3E%20(property)%20scheme%20%3E%20(member)%200">Link to this property</a>

const ConfigNewResponseIntegrationSchemePostgresql ConfigNewResponseIntegrationScheme = "postgresql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration%20%3E%20(property)%20scheme%20%3E%20(member)%201">Link to this property</a>

const ConfigNewResponseIntegrationSchemeMysql ConfigNewResponseIntegrationScheme = "mysql"

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration%20%3E%20(property)%20scheme%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration%20%3E%20(property)%20scheme">Link to this property</a>

CustomDatabaseName stringOptional

The database name to use when connecting. Defaults to <code>postgres</code> for PostgreSQL and <code>mysql</code> for MySQL.

maxLength2048

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration%20%3E%20(property)%20custom_database_name">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20integration">Link to this property</a>

ModifiedOn TimeOptional

Defines the last modified time of the Hyperdrive configuration.

formatdate-time

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20modified_on">Link to this property</a>

<details>

<summary>

MTLS ConfigNewResponseMTLSOptional

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

</summary>

CACertificateID stringOptional

Define CA certificate ID obtained after uploading CA cert.

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20mtls%20%3E%20(property)%20ca_certificate_id">Link to this property</a>

MTLSCertificateID stringOptional

Define mTLS certificate ID obtained after uploading client cert.

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20mtls%20%3E%20(property)%20mtls_certificate_id">Link to this property</a>

Sslmode stringOptional

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

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20mtls%20%3E%20(property)%20sslmode">Link to this property</a>

</details>

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20mtls">Link to this property</a>

OriginConnectionLimit int64Optional

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.

minimum5

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20origin_connection_limit">Link to this property</a>

RestartedOn TimeOptional

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

formatdate-time

<a href="#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)%20%3E%20(property)%20restarted_on">Link to this property</a>

</details>

[Link to this property](<#(resource)%20hyperdrive.configs%20%3E%20(model)%20ConfigNewResponse%20%3E%20(schema)>)

### Create Hyperdrive

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/hyperdrive"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  config, err := client.Hyperdrive.Configs.New(context.TODO(), hyperdrive.ConfigNewParams{
    AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    Body: hyperdrive.ConfigNewParamsBodyHyperdriveHyperdriveConfigCreateWithOrigin{
      Name: cloudflare.F("example-hyperdrive"),
      Origin: cloudflare.F[hyperdrive.ConfigNewParamsBodyHyperdriveHyperdriveConfigCreateWithOriginOriginUnion](hyperdrive.ConfigNewParamsBodyHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabase{
        Database: cloudflare.F("postgres"),
        Host: cloudflare.F("database.example.com"),
        Password: cloudflare.F("password"),
        Port: cloudflare.F(int64(5432)),
        Scheme: cloudflare.F(hyperdrive.ConfigNewParamsBodyHyperdriveHyperdriveConfigCreateWithOriginOriginPublicDatabaseSchemePostgres),
        User: cloudflare.F("postgres"),
      }),
    },
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", config.ID)
}
```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "caching": {
      "disabled": true,
      "max_age": 1,
      "stale_while_revalidate": 0
    },
    "name": "example-hyperdrive",
    "origin": {
      "database": "postgres",
      "host": "database.example.com",
      "port": 5432,
      "scheme": "postgres",
      "user": "postgres"
    },
    "created_on": "2017-01-01T00:00:00Z",
    "integration": {
      "database_branch_name": "x",
      "database_name": "x",
      "organization_name": "x",
      "provider": "planetscale",
      "scheme": "postgres",
      "custom_database_name": "custom_database_name"
    },
    "modified_on": "2017-01-01T00:00:00Z",
    "mtls": {
      "ca_certificate_id": "00000000-0000-0000-0000-0000000000",
      "mtls_certificate_id": "00000000-0000-0000-0000-0000000000",
      "sslmode": "verify-full"
    },
    "origin_connection_limit": 60,
    "restarted_on": "2017-01-01T00:00:00Z"
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "caching": {
      "disabled": true,
      "max_age": 1,
      "stale_while_revalidate": 0
    },
    "name": "example-hyperdrive",
    "origin": {
      "database": "postgres",
      "host": "database.example.com",
      "port": 5432,
      "scheme": "postgres",
      "user": "postgres"
    },
    "created_on": "2017-01-01T00:00:00Z",
    "integration": {
      "database_branch_name": "x",
      "database_name": "x",
      "organization_name": "x",
      "provider": "planetscale",
      "scheme": "postgres",
      "custom_database_name": "custom_database_name"
    },
    "modified_on": "2017-01-01T00:00:00Z",
    "mtls": {
      "ca_certificate_id": "00000000-0000-0000-0000-0000000000",
      "mtls_certificate_id": "00000000-0000-0000-0000-0000000000",
      "sslmode": "verify-full"
    },
    "origin_connection_limit": 60,
    "restarted_on": "2017-01-01T00:00:00Z"
  },
  "success": true
}
```