1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. HyperdriveConfig
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

cloudflare.HyperdriveConfig

Explore with Pulumi AI

cloudflare logo
Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleHyperdriveConfig = new cloudflare.HyperdriveConfig("example_hyperdrive_config", {
        accountId: "023e105f4ecef8ad9ca31a8372d0c353",
        name: "example-hyperdrive",
        origin: {
            database: "postgres",
            host: "database.example.com",
            password: "password",
            port: 5432,
            scheme: "postgres",
            user: "postgres",
        },
        caching: {
            disabled: true,
        },
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_hyperdrive_config = cloudflare.HyperdriveConfig("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,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.NewHyperdriveConfig(ctx, "example_hyperdrive_config", &cloudflare.HyperdriveConfigArgs{
    			AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
    			Name:      pulumi.String("example-hyperdrive"),
    			Origin: &cloudflare.HyperdriveConfigOriginArgs{
    				Database: pulumi.String("postgres"),
    				Host:     pulumi.String("database.example.com"),
    				Password: pulumi.String("password"),
    				Port:     pulumi.Int(5432),
    				Scheme:   pulumi.String("postgres"),
    				User:     pulumi.String("postgres"),
    			},
    			Caching: &cloudflare.HyperdriveConfigCachingArgs{
    				Disabled: pulumi.Bool(true),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cloudflare = Pulumi.Cloudflare;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleHyperdriveConfig = new Cloudflare.HyperdriveConfig("example_hyperdrive_config", new()
        {
            AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
            Name = "example-hyperdrive",
            Origin = new Cloudflare.Inputs.HyperdriveConfigOriginArgs
            {
                Database = "postgres",
                Host = "database.example.com",
                Password = "password",
                Port = 5432,
                Scheme = "postgres",
                User = "postgres",
            },
            Caching = new Cloudflare.Inputs.HyperdriveConfigCachingArgs
            {
                Disabled = true,
            },
        });
    
    });
    
    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 com.pulumi.cloudflare.inputs.HyperdriveConfigCachingArgs;
    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 exampleHyperdriveConfig = new HyperdriveConfig("exampleHyperdriveConfig", HyperdriveConfigArgs.builder()
                .accountId("023e105f4ecef8ad9ca31a8372d0c353")
                .name("example-hyperdrive")
                .origin(HyperdriveConfigOriginArgs.builder()
                    .database("postgres")
                    .host("database.example.com")
                    .password("password")
                    .port(5432)
                    .scheme("postgres")
                    .user("postgres")
                    .build())
                .caching(HyperdriveConfigCachingArgs.builder()
                    .disabled(true)
                    .build())
                .build());
    
        }
    }
    
    resources:
      exampleHyperdriveConfig:
        type: cloudflare:HyperdriveConfig
        name: example_hyperdrive_config
        properties:
          accountId: 023e105f4ecef8ad9ca31a8372d0c353
          name: example-hyperdrive
          origin:
            database: postgres
            host: database.example.com
            password: password
            port: 5432
            scheme: postgres
            user: postgres
          caching:
            disabled: true
    

    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)
    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 string
    The unique name of the resource.
    args HyperdriveConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args HyperdriveConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HyperdriveConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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,
        },
    });
    
    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),
    	},
    })
    
    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())
        .build());
    
    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,
        })
    
    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,
        },
    });
    
    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
    

    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:

    Outputs

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

    CreatedOn string
    When the Hyperdrive configuration was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    When the Hyperdrive configuration was last modified.
    CreatedOn string
    When the Hyperdrive configuration was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    ModifiedOn string
    When the Hyperdrive configuration was last modified.
    createdOn String
    When the Hyperdrive configuration was created.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    When the Hyperdrive configuration was last modified.
    createdOn string
    When the Hyperdrive configuration was created.
    id string
    The provider-assigned unique ID for this managed resource.
    modifiedOn string
    When the Hyperdrive configuration was last modified.
    created_on str
    When the Hyperdrive configuration was created.
    id str
    The provider-assigned unique ID for this managed resource.
    modified_on str
    When the Hyperdrive configuration was last modified.
    createdOn String
    When the Hyperdrive configuration was created.
    id String
    The provider-assigned unique ID for this managed resource.
    modifiedOn String
    When the Hyperdrive configuration was last modified.

    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,
            created_on: Optional[str] = None,
            modified_on: Optional[str] = None,
            name: Optional[str] = None,
            origin: Optional[HyperdriveConfigOriginArgs] = 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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    Identifier
    Caching HyperdriveConfigCaching
    CreatedOn string
    When the Hyperdrive configuration was created.
    ModifiedOn string
    When the Hyperdrive configuration was last modified.
    Name string
    Origin HyperdriveConfigOrigin
    AccountId string
    Identifier
    Caching HyperdriveConfigCachingArgs
    CreatedOn string
    When the Hyperdrive configuration was created.
    ModifiedOn string
    When the Hyperdrive configuration was last modified.
    Name string
    Origin HyperdriveConfigOriginArgs
    accountId String
    Identifier
    caching HyperdriveConfigCaching
    createdOn String
    When the Hyperdrive configuration was created.
    modifiedOn String
    When the Hyperdrive configuration was last modified.
    name String
    origin HyperdriveConfigOrigin
    accountId string
    Identifier
    caching HyperdriveConfigCaching
    createdOn string
    When the Hyperdrive configuration was created.
    modifiedOn string
    When the Hyperdrive configuration was last modified.
    name string
    origin HyperdriveConfigOrigin
    account_id str
    Identifier
    caching HyperdriveConfigCachingArgs
    created_on str
    When the Hyperdrive configuration was created.
    modified_on str
    When the Hyperdrive configuration was last modified.
    name str
    origin HyperdriveConfigOriginArgs
    accountId String
    Identifier
    caching Property Map
    createdOn String
    When the Hyperdrive configuration was created.
    modifiedOn String
    When the Hyperdrive configuration was last modified.
    name String
    origin Property Map

    Supporting Types

    HyperdriveConfigCaching, HyperdriveConfigCachingArgs

    Disabled bool
    When set to true, disables the caching of SQL responses. (Default: false)
    MaxAge int
    When present, specifies max duration for which items should persist in the cache. Not returned if set to default. (Default: 60)
    StaleWhileRevalidate int
    When present, indicates the number of seconds cache may serve the response after it becomes stale. Not returned if set to default. (Default: 15)
    Disabled bool
    When set to true, disables the caching of SQL responses. (Default: false)
    MaxAge int
    When present, specifies max duration for which items should persist in the cache. Not returned if set to default. (Default: 60)
    StaleWhileRevalidate int
    When present, indicates the number of seconds cache may serve the response after it becomes stale. Not returned if set to default. (Default: 15)
    disabled Boolean
    When set to true, disables the caching of SQL responses. (Default: false)
    maxAge Integer
    When present, specifies max duration for which items should persist in the cache. Not returned if set to default. (Default: 60)
    staleWhileRevalidate Integer
    When present, indicates the number of seconds cache may serve the response after it becomes stale. Not returned if set to default. (Default: 15)
    disabled boolean
    When set to true, disables the caching of SQL responses. (Default: false)
    maxAge number
    When present, specifies max duration for which items should persist in the cache. Not returned if set to default. (Default: 60)
    staleWhileRevalidate number
    When present, indicates the number of seconds cache may serve the response after it becomes stale. Not returned if set to default. (Default: 15)
    disabled bool
    When set to true, disables the caching of SQL responses. (Default: false)
    max_age int
    When present, specifies max duration for which items should persist in the cache. Not returned if set to default. (Default: 60)
    stale_while_revalidate int
    When present, indicates the number of seconds cache may serve the response after it becomes stale. Not returned if set to default. (Default: 15)
    disabled Boolean
    When set to true, disables the caching of SQL responses. (Default: false)
    maxAge Number
    When present, specifies max duration for which items should persist in the cache. Not returned if set to default. (Default: 60)
    staleWhileRevalidate Number
    When present, indicates the number of seconds cache may serve the response after it becomes stale. Not returned if set to default. (Default: 15)

    HyperdriveConfigOrigin, HyperdriveConfigOriginArgs

    Database string
    The name of your origin database.
    Host string
    The host (hostname or IP) of your origin database.
    Password string
    The password required to access your origin database. This value is write-only and never returned by the API.
    Scheme string
    Specifies the URL scheme used to connect to your origin database. Available values: "postgres", "postgresql".
    User string
    The user of your origin database.
    AccessClientId string
    The Client ID of the Access token to use when connecting to the origin database.
    AccessClientSecret string
    The Client Secret of the Access token to use when connecting to the origin database. This value is write-only and never returned by the API.
    Port int
    The port (default: 5432 for Postgres) of your origin database.
    Database string
    The name of your origin database.
    Host string
    The host (hostname or IP) of your origin database.
    Password string
    The password required to access your origin database. This value is write-only and never returned by the API.
    Scheme string
    Specifies the URL scheme used to connect to your origin database. Available values: "postgres", "postgresql".
    User string
    The user of your origin database.
    AccessClientId string
    The Client ID of the Access token to use when connecting to the origin database.
    AccessClientSecret string
    The Client Secret of the Access token to use when connecting to the origin database. This value is write-only and never returned by the API.
    Port int
    The port (default: 5432 for Postgres) of your origin database.
    database String
    The name of your origin database.
    host String
    The host (hostname or IP) of your origin database.
    password String
    The password required to access your origin database. This value is write-only and never returned by the API.
    scheme String
    Specifies the URL scheme used to connect to your origin database. Available values: "postgres", "postgresql".
    user String
    The user of your origin database.
    accessClientId String
    The Client ID of the Access token to use when connecting to the origin database.
    accessClientSecret String
    The Client Secret of the Access token to use when connecting to the origin database. This value is write-only and never returned by the API.
    port Integer
    The port (default: 5432 for Postgres) of your origin database.
    database string
    The name of your origin database.
    host string
    The host (hostname or IP) of your origin database.
    password string
    The password required to access your origin database. This value is write-only and never returned by the API.
    scheme string
    Specifies the URL scheme used to connect to your origin database. Available values: "postgres", "postgresql".
    user string
    The user of your origin database.
    accessClientId string
    The Client ID of the Access token to use when connecting to the origin database.
    accessClientSecret string
    The Client Secret of the Access token to use when connecting to the origin database. This value is write-only and never returned by the API.
    port number
    The port (default: 5432 for Postgres) of your origin database.
    database str
    The name of your origin database.
    host str
    The host (hostname or IP) of your origin database.
    password str
    The password required to access your origin database. This value is write-only and never returned by the API.
    scheme str
    Specifies the URL scheme used to connect to your origin database. Available values: "postgres", "postgresql".
    user str
    The user of your origin database.
    access_client_id str
    The Client ID of the Access token to use when connecting to the origin database.
    access_client_secret str
    The Client Secret of the Access token to use when connecting to the origin database. This value is write-only and never returned by the API.
    port int
    The port (default: 5432 for Postgres) of your origin database.
    database String
    The name of your origin database.
    host String
    The host (hostname or IP) of your origin database.
    password String
    The password required to access your origin database. This value is write-only and never returned by the API.
    scheme String
    Specifies the URL scheme used to connect to your origin database. Available values: "postgres", "postgresql".
    user String
    The user of your origin database.
    accessClientId String
    The Client ID of the Access token to use when connecting to the origin database.
    accessClientSecret String
    The Client Secret of the Access token to use when connecting to the origin database. This value is write-only and never returned by the API.
    port Number
    The port (default: 5432 for Postgres) of your origin database.

    Import

    $ pulumi import cloudflare:index/hyperdriveConfig:HyperdriveConfig example '<account_id>/<hyperdrive_id>'
    

    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.
    cloudflare logo
    Cloudflare v6.1.2 published on Monday, Apr 28, 2025 by Pulumi