1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. HyperdriveConfig
Cloudflare v5.49.1 published on Tuesday, Feb 18, 2025 by Pulumi

cloudflare.HyperdriveConfig

Explore with Pulumi AI

The Hyperdrive Config resource allows you to manage Cloudflare Hyperdrive Configs.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const noDefaults = new cloudflare.HyperdriveConfig("no_defaults", {
    accountId: "f037e56e89293a057740de681ac9abbe",
    name: "my-hyperdrive-config",
    origin: {
        database: "postgres",
        password: "my-password",
        host: "my-database.example.com",
        port: 5432,
        scheme: "postgres",
        user: "my-user",
    },
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

no_defaults = cloudflare.HyperdriveConfig("no_defaults",
    account_id="f037e56e89293a057740de681ac9abbe",
    name="my-hyperdrive-config",
    origin={
        "database": "postgres",
        "password": "my-password",
        "host": "my-database.example.com",
        "port": 5432,
        "scheme": "postgres",
        "user": "my-user",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewHyperdriveConfig(ctx, "no_defaults", &cloudflare.HyperdriveConfigArgs{
			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
			Name:      pulumi.String("my-hyperdrive-config"),
			Origin: &cloudflare.HyperdriveConfigOriginArgs{
				Database: pulumi.String("postgres"),
				Password: pulumi.String("my-password"),
				Host:     pulumi.String("my-database.example.com"),
				Port:     pulumi.Int(5432),
				Scheme:   pulumi.String("postgres"),
				User:     pulumi.String("my-user"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var noDefaults = new Cloudflare.HyperdriveConfig("no_defaults", new()
    {
        AccountId = "f037e56e89293a057740de681ac9abbe",
        Name = "my-hyperdrive-config",
        Origin = new Cloudflare.Inputs.HyperdriveConfigOriginArgs
        {
            Database = "postgres",
            Password = "my-password",
            Host = "my-database.example.com",
            Port = 5432,
            Scheme = "postgres",
            User = "my-user",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.HyperdriveConfig;
import com.pulumi.cloudflare.HyperdriveConfigArgs;
import com.pulumi.cloudflare.inputs.HyperdriveConfigOriginArgs;
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 noDefaults = new HyperdriveConfig("noDefaults", HyperdriveConfigArgs.builder()
            .accountId("f037e56e89293a057740de681ac9abbe")
            .name("my-hyperdrive-config")
            .origin(HyperdriveConfigOriginArgs.builder()
                .database("postgres")
                .password("my-password")
                .host("my-database.example.com")
                .port(5432)
                .scheme("postgres")
                .user("my-user")
                .build())
            .build());

    }
}
Copy
resources:
  noDefaults:
    type: cloudflare:HyperdriveConfig
    name: no_defaults
    properties:
      accountId: f037e56e89293a057740de681ac9abbe
      name: my-hyperdrive-config
      origin:
        database: postgres
        password: my-password
        host: my-database.example.com
        port: 5432
        scheme: postgres
        user: my-user
Copy

Create HyperdriveConfig Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new HyperdriveConfig(name: string, args: HyperdriveConfigArgs, opts?: CustomResourceOptions);
@overload
def HyperdriveConfig(resource_name: str,
                     args: HyperdriveConfigArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def HyperdriveConfig(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     account_id: Optional[str] = None,
                     name: Optional[str] = None,
                     origin: Optional[HyperdriveConfigOriginArgs] = None,
                     caching: Optional[HyperdriveConfigCachingArgs] = None,
                     resource_id: Optional[str] = None)
func NewHyperdriveConfig(ctx *Context, name string, args HyperdriveConfigArgs, opts ...ResourceOption) (*HyperdriveConfig, error)
public HyperdriveConfig(string name, HyperdriveConfigArgs args, CustomResourceOptions? opts = null)
public HyperdriveConfig(String name, HyperdriveConfigArgs args)
public HyperdriveConfig(String name, HyperdriveConfigArgs args, CustomResourceOptions options)
type: cloudflare:HyperdriveConfig
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. HyperdriveConfigArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. HyperdriveConfigArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. HyperdriveConfigArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. HyperdriveConfigArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. HyperdriveConfigArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var hyperdriveConfigResource = new Cloudflare.HyperdriveConfig("hyperdriveConfigResource", new()
{
    AccountId = "string",
    Name = "string",
    Origin = new Cloudflare.Inputs.HyperdriveConfigOriginArgs
    {
        Database = "string",
        Host = "string",
        Password = "string",
        Scheme = "string",
        User = "string",
        AccessClientId = "string",
        AccessClientSecret = "string",
        Port = 0,
    },
    Caching = new Cloudflare.Inputs.HyperdriveConfigCachingArgs
    {
        Disabled = false,
        MaxAge = 0,
        StaleWhileRevalidate = 0,
    },
    ResourceId = "string",
});
Copy
example, err := cloudflare.NewHyperdriveConfig(ctx, "hyperdriveConfigResource", &cloudflare.HyperdriveConfigArgs{
	AccountId: pulumi.String("string"),
	Name:      pulumi.String("string"),
	Origin: &cloudflare.HyperdriveConfigOriginArgs{
		Database:           pulumi.String("string"),
		Host:               pulumi.String("string"),
		Password:           pulumi.String("string"),
		Scheme:             pulumi.String("string"),
		User:               pulumi.String("string"),
		AccessClientId:     pulumi.String("string"),
		AccessClientSecret: pulumi.String("string"),
		Port:               pulumi.Int(0),
	},
	Caching: &cloudflare.HyperdriveConfigCachingArgs{
		Disabled:             pulumi.Bool(false),
		MaxAge:               pulumi.Int(0),
		StaleWhileRevalidate: pulumi.Int(0),
	},
	ResourceId: pulumi.String("string"),
})
Copy
var hyperdriveConfigResource = new HyperdriveConfig("hyperdriveConfigResource", HyperdriveConfigArgs.builder()
    .accountId("string")
    .name("string")
    .origin(HyperdriveConfigOriginArgs.builder()
        .database("string")
        .host("string")
        .password("string")
        .scheme("string")
        .user("string")
        .accessClientId("string")
        .accessClientSecret("string")
        .port(0)
        .build())
    .caching(HyperdriveConfigCachingArgs.builder()
        .disabled(false)
        .maxAge(0)
        .staleWhileRevalidate(0)
        .build())
    .resourceId("string")
    .build());
Copy
hyperdrive_config_resource = cloudflare.HyperdriveConfig("hyperdriveConfigResource",
    account_id="string",
    name="string",
    origin={
        "database": "string",
        "host": "string",
        "password": "string",
        "scheme": "string",
        "user": "string",
        "access_client_id": "string",
        "access_client_secret": "string",
        "port": 0,
    },
    caching={
        "disabled": False,
        "max_age": 0,
        "stale_while_revalidate": 0,
    },
    resource_id="string")
Copy
const hyperdriveConfigResource = new cloudflare.HyperdriveConfig("hyperdriveConfigResource", {
    accountId: "string",
    name: "string",
    origin: {
        database: "string",
        host: "string",
        password: "string",
        scheme: "string",
        user: "string",
        accessClientId: "string",
        accessClientSecret: "string",
        port: 0,
    },
    caching: {
        disabled: false,
        maxAge: 0,
        staleWhileRevalidate: 0,
    },
    resourceId: "string",
});
Copy
type: cloudflare:HyperdriveConfig
properties:
    accountId: string
    caching:
        disabled: false
        maxAge: 0
        staleWhileRevalidate: 0
    name: string
    origin:
        accessClientId: string
        accessClientSecret: string
        database: string
        host: string
        password: string
        port: 0
        scheme: string
        user: string
    resourceId: string
Copy

HyperdriveConfig Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The HyperdriveConfig resource accepts the following input properties:

AccountId This property is required. string
The account identifier to target for the resource.
Name This property is required. string
The name of the Hyperdrive configuration.
Origin This property is required. HyperdriveConfigOrigin
The origin details for the Hyperdrive configuration.
Caching HyperdriveConfigCaching
The caching details for the Hyperdrive configuration.
ResourceId string
The identifier of this resource. This is the hyperdrive config value.
AccountId This property is required. string
The account identifier to target for the resource.
Name This property is required. string
The name of the Hyperdrive configuration.
Origin This property is required. HyperdriveConfigOriginArgs
The origin details for the Hyperdrive configuration.
Caching HyperdriveConfigCachingArgs
The caching details for the Hyperdrive configuration.
ResourceId string
The identifier of this resource. This is the hyperdrive config value.
accountId This property is required. String
The account identifier to target for the resource.
name This property is required. String
The name of the Hyperdrive configuration.
origin This property is required. HyperdriveConfigOrigin
The origin details for the Hyperdrive configuration.
caching HyperdriveConfigCaching
The caching details for the Hyperdrive configuration.
resourceId String
The identifier of this resource. This is the hyperdrive config value.
accountId This property is required. string
The account identifier to target for the resource.
name This property is required. string
The name of the Hyperdrive configuration.
origin This property is required. HyperdriveConfigOrigin
The origin details for the Hyperdrive configuration.
caching HyperdriveConfigCaching
The caching details for the Hyperdrive configuration.
resourceId string
The identifier of this resource. This is the hyperdrive config value.
account_id This property is required. str
The account identifier to target for the resource.
name This property is required. str
The name of the Hyperdrive configuration.
origin This property is required. HyperdriveConfigOriginArgs
The origin details for the Hyperdrive configuration.
caching HyperdriveConfigCachingArgs
The caching details for the Hyperdrive configuration.
resource_id str
The identifier of this resource. This is the hyperdrive config value.
accountId This property is required. String
The account identifier to target for the resource.
name This property is required. String
The name of the Hyperdrive configuration.
origin This property is required. Property Map
The origin details for the Hyperdrive configuration.
caching Property Map
The caching details for the Hyperdrive configuration.
resourceId String
The identifier of this resource. This is the hyperdrive config value.

Outputs

All input properties are implicitly available as output properties. Additionally, the HyperdriveConfig resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing HyperdriveConfig Resource

Get an existing HyperdriveConfig resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: HyperdriveConfigState, opts?: CustomResourceOptions): HyperdriveConfig
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        caching: Optional[HyperdriveConfigCachingArgs] = None,
        name: Optional[str] = None,
        origin: Optional[HyperdriveConfigOriginArgs] = None,
        resource_id: Optional[str] = None) -> HyperdriveConfig
func GetHyperdriveConfig(ctx *Context, name string, id IDInput, state *HyperdriveConfigState, opts ...ResourceOption) (*HyperdriveConfig, error)
public static HyperdriveConfig Get(string name, Input<string> id, HyperdriveConfigState? state, CustomResourceOptions? opts = null)
public static HyperdriveConfig get(String name, Output<String> id, HyperdriveConfigState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:HyperdriveConfig    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccountId string
The account identifier to target for the resource.
Caching HyperdriveConfigCaching
The caching details for the Hyperdrive configuration.
Name string
The name of the Hyperdrive configuration.
Origin HyperdriveConfigOrigin
The origin details for the Hyperdrive configuration.
ResourceId string
The identifier of this resource. This is the hyperdrive config value.
AccountId string
The account identifier to target for the resource.
Caching HyperdriveConfigCachingArgs
The caching details for the Hyperdrive configuration.
Name string
The name of the Hyperdrive configuration.
Origin HyperdriveConfigOriginArgs
The origin details for the Hyperdrive configuration.
ResourceId string
The identifier of this resource. This is the hyperdrive config value.
accountId String
The account identifier to target for the resource.
caching HyperdriveConfigCaching
The caching details for the Hyperdrive configuration.
name String
The name of the Hyperdrive configuration.
origin HyperdriveConfigOrigin
The origin details for the Hyperdrive configuration.
resourceId String
The identifier of this resource. This is the hyperdrive config value.
accountId string
The account identifier to target for the resource.
caching HyperdriveConfigCaching
The caching details for the Hyperdrive configuration.
name string
The name of the Hyperdrive configuration.
origin HyperdriveConfigOrigin
The origin details for the Hyperdrive configuration.
resourceId string
The identifier of this resource. This is the hyperdrive config value.
account_id str
The account identifier to target for the resource.
caching HyperdriveConfigCachingArgs
The caching details for the Hyperdrive configuration.
name str
The name of the Hyperdrive configuration.
origin HyperdriveConfigOriginArgs
The origin details for the Hyperdrive configuration.
resource_id str
The identifier of this resource. This is the hyperdrive config value.
accountId String
The account identifier to target for the resource.
caching Property Map
The caching details for the Hyperdrive configuration.
name String
The name of the Hyperdrive configuration.
origin Property Map
The origin details for the Hyperdrive configuration.
resourceId String
The identifier of this resource. This is the hyperdrive config value.

Supporting Types

HyperdriveConfigCaching
, HyperdriveConfigCachingArgs

Disabled bool
Disable caching for this Hyperdrive configuration.
MaxAge int
Configure the max_age value of this Hyperdrive configuration.
StaleWhileRevalidate int
Disable caching for this Hyperdrive configuration.
Disabled bool
Disable caching for this Hyperdrive configuration.
MaxAge int
Configure the max_age value of this Hyperdrive configuration.
StaleWhileRevalidate int
Disable caching for this Hyperdrive configuration.
disabled Boolean
Disable caching for this Hyperdrive configuration.
maxAge Integer
Configure the max_age value of this Hyperdrive configuration.
staleWhileRevalidate Integer
Disable caching for this Hyperdrive configuration.
disabled boolean
Disable caching for this Hyperdrive configuration.
maxAge number
Configure the max_age value of this Hyperdrive configuration.
staleWhileRevalidate number
Disable caching for this Hyperdrive configuration.
disabled bool
Disable caching for this Hyperdrive configuration.
max_age int
Configure the max_age value of this Hyperdrive configuration.
stale_while_revalidate int
Disable caching for this Hyperdrive configuration.
disabled Boolean
Disable caching for this Hyperdrive configuration.
maxAge Number
Configure the max_age value of this Hyperdrive configuration.
staleWhileRevalidate Number
Disable caching for this Hyperdrive configuration.

HyperdriveConfigOrigin
, HyperdriveConfigOriginArgs

Database This property is required. string
The name of your origin database.
Host This property is required. string
The host (hostname or IP) of your origin database.
Password This property is required. string
The password of the Hyperdrive configuration.
Scheme This property is required. string
Specifies the URL scheme used to connect to your origin database.
User This property is required. string
The user of your origin database.
AccessClientId string
Client ID associated with the Cloudflare Access Service Token used to connect via Access.
AccessClientSecret string
Client Secret associated with the Cloudflare Access Service Token used to connect via Access.
Port int
The port (default: 5432 for Postgres) of your origin database.
Database This property is required. string
The name of your origin database.
Host This property is required. string
The host (hostname or IP) of your origin database.
Password This property is required. string
The password of the Hyperdrive configuration.
Scheme This property is required. string
Specifies the URL scheme used to connect to your origin database.
User This property is required. string
The user of your origin database.
AccessClientId string
Client ID associated with the Cloudflare Access Service Token used to connect via Access.
AccessClientSecret string
Client Secret associated with the Cloudflare Access Service Token used to connect via Access.
Port int
The port (default: 5432 for Postgres) of your origin database.
database This property is required. String
The name of your origin database.
host This property is required. String
The host (hostname or IP) of your origin database.
password This property is required. String
The password of the Hyperdrive configuration.
scheme This property is required. String
Specifies the URL scheme used to connect to your origin database.
user This property is required. String
The user of your origin database.
accessClientId String
Client ID associated with the Cloudflare Access Service Token used to connect via Access.
accessClientSecret String
Client Secret associated with the Cloudflare Access Service Token used to connect via Access.
port Integer
The port (default: 5432 for Postgres) of your origin database.
database This property is required. string
The name of your origin database.
host This property is required. string
The host (hostname or IP) of your origin database.
password This property is required. string
The password of the Hyperdrive configuration.
scheme This property is required. string
Specifies the URL scheme used to connect to your origin database.
user This property is required. string
The user of your origin database.
accessClientId string
Client ID associated with the Cloudflare Access Service Token used to connect via Access.
accessClientSecret string
Client Secret associated with the Cloudflare Access Service Token used to connect via Access.
port number
The port (default: 5432 for Postgres) of your origin database.
database This property is required. str
The name of your origin database.
host This property is required. str
The host (hostname or IP) of your origin database.
password This property is required. str
The password of the Hyperdrive configuration.
scheme This property is required. str
Specifies the URL scheme used to connect to your origin database.
user This property is required. str
The user of your origin database.
access_client_id str
Client ID associated with the Cloudflare Access Service Token used to connect via Access.
access_client_secret str
Client Secret associated with the Cloudflare Access Service Token used to connect via Access.
port int
The port (default: 5432 for Postgres) of your origin database.
database This property is required. String
The name of your origin database.
host This property is required. String
The host (hostname or IP) of your origin database.
password This property is required. String
The password of the Hyperdrive configuration.
scheme This property is required. String
Specifies the URL scheme used to connect to your origin database.
user This property is required. String
The user of your origin database.
accessClientId String
Client ID associated with the Cloudflare Access Service Token used to connect via Access.
accessClientSecret String
Client Secret associated with the Cloudflare Access Service Token used to connect via Access.
port Number
The port (default: 5432 for Postgres) of your origin database.

Import

$ pulumi import cloudflare:index/hyperdriveConfig:HyperdriveConfig example <account_id>/<hyperdrive_config_id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.