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

cloudflare.RegionalHostname

Explore with Pulumi AI

Provides a Data Localization Suite Regional Hostname.

Example Usage

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

// Regionalized hostname record resources are managed independently from the
// Regionalized Hostname resources.
const example = new cloudflare.Record("example", {
    zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
    name: "example.com",
    content: "192.0.2.1",
    type: "A",
    ttl: 3600,
});
// The cloudflare_regional_hostname resource may exist with or without its
// corresponding record resource.
const exampleRegionalHostname = new cloudflare.RegionalHostname("example", {
    zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
    hostname: "example.com",
    regionKey: "eu",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

# Regionalized hostname record resources are managed independently from the
# Regionalized Hostname resources.
example = cloudflare.Record("example",
    zone_id="0da42c8d2132a9ddaf714f9e7c920711",
    name="example.com",
    content="192.0.2.1",
    type="A",
    ttl=3600)
# The cloudflare_regional_hostname resource may exist with or without its
# corresponding record resource.
example_regional_hostname = cloudflare.RegionalHostname("example",
    zone_id="0da42c8d2132a9ddaf714f9e7c920711",
    hostname="example.com",
    region_key="eu")
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 {
		// Regionalized hostname record resources are managed independently from the
		// Regionalized Hostname resources.
		_, err := cloudflare.NewRecord(ctx, "example", &cloudflare.RecordArgs{
			ZoneId:  pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
			Name:    pulumi.String("example.com"),
			Content: pulumi.String("192.0.2.1"),
			Type:    pulumi.String("A"),
			Ttl:     pulumi.Int(3600),
		})
		if err != nil {
			return err
		}
		// The cloudflare_regional_hostname resource may exist with or without its
		// corresponding record resource.
		_, err = cloudflare.NewRegionalHostname(ctx, "example", &cloudflare.RegionalHostnameArgs{
			ZoneId:    pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
			Hostname:  pulumi.String("example.com"),
			RegionKey: pulumi.String("eu"),
		})
		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(() => 
{
    // Regionalized hostname record resources are managed independently from the
    // Regionalized Hostname resources.
    var example = new Cloudflare.Record("example", new()
    {
        ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
        Name = "example.com",
        Content = "192.0.2.1",
        Type = "A",
        Ttl = 3600,
    });

    // The cloudflare_regional_hostname resource may exist with or without its
    // corresponding record resource.
    var exampleRegionalHostname = new Cloudflare.RegionalHostname("example", new()
    {
        ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
        Hostname = "example.com",
        RegionKey = "eu",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.Record;
import com.pulumi.cloudflare.RecordArgs;
import com.pulumi.cloudflare.RegionalHostname;
import com.pulumi.cloudflare.RegionalHostnameArgs;
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) {
        // Regionalized hostname record resources are managed independently from the
        // Regionalized Hostname resources.
        var example = new Record("example", RecordArgs.builder()
            .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
            .name("example.com")
            .content("192.0.2.1")
            .type("A")
            .ttl(3600)
            .build());

        // The cloudflare_regional_hostname resource may exist with or without its
        // corresponding record resource.
        var exampleRegionalHostname = new RegionalHostname("exampleRegionalHostname", RegionalHostnameArgs.builder()
            .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
            .hostname("example.com")
            .regionKey("eu")
            .build());

    }
}
Copy
resources:
  # Regionalized hostname record resources are managed independently from the
  # Regionalized Hostname resources.
  example:
    type: cloudflare:Record
    properties:
      zoneId: 0da42c8d2132a9ddaf714f9e7c920711
      name: example.com
      content: 192.0.2.1
      type: A
      ttl: 3600
  # The cloudflare_regional_hostname resource may exist with or without its
  # corresponding record resource.
  exampleRegionalHostname:
    type: cloudflare:RegionalHostname
    name: example
    properties:
      zoneId: 0da42c8d2132a9ddaf714f9e7c920711
      hostname: example.com
      regionKey: eu
Copy

Create RegionalHostname Resource

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

Constructor syntax

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

@overload
def RegionalHostname(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     hostname: Optional[str] = None,
                     region_key: Optional[str] = None,
                     zone_id: Optional[str] = None)
func NewRegionalHostname(ctx *Context, name string, args RegionalHostnameArgs, opts ...ResourceOption) (*RegionalHostname, error)
public RegionalHostname(string name, RegionalHostnameArgs args, CustomResourceOptions? opts = null)
public RegionalHostname(String name, RegionalHostnameArgs args)
public RegionalHostname(String name, RegionalHostnameArgs args, CustomResourceOptions options)
type: cloudflare:RegionalHostname
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. RegionalHostnameArgs
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. RegionalHostnameArgs
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. RegionalHostnameArgs
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. RegionalHostnameArgs
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. RegionalHostnameArgs
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 regionalHostnameResource = new Cloudflare.RegionalHostname("regionalHostnameResource", new()
{
    Hostname = "string",
    RegionKey = "string",
    ZoneId = "string",
});
Copy
example, err := cloudflare.NewRegionalHostname(ctx, "regionalHostnameResource", &cloudflare.RegionalHostnameArgs{
	Hostname:  pulumi.String("string"),
	RegionKey: pulumi.String("string"),
	ZoneId:    pulumi.String("string"),
})
Copy
var regionalHostnameResource = new RegionalHostname("regionalHostnameResource", RegionalHostnameArgs.builder()
    .hostname("string")
    .regionKey("string")
    .zoneId("string")
    .build());
Copy
regional_hostname_resource = cloudflare.RegionalHostname("regionalHostnameResource",
    hostname="string",
    region_key="string",
    zone_id="string")
Copy
const regionalHostnameResource = new cloudflare.RegionalHostname("regionalHostnameResource", {
    hostname: "string",
    regionKey: "string",
    zoneId: "string",
});
Copy
type: cloudflare:RegionalHostname
properties:
    hostname: string
    regionKey: string
    zoneId: string
Copy

RegionalHostname 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 RegionalHostname resource accepts the following input properties:

Hostname This property is required. string
The hostname to regionalize.
RegionKey This property is required. string
The region key. See the full region list.
ZoneId This property is required. string
The zone identifier to target for the resource.
Hostname This property is required. string
The hostname to regionalize.
RegionKey This property is required. string
The region key. See the full region list.
ZoneId This property is required. string
The zone identifier to target for the resource.
hostname This property is required. String
The hostname to regionalize.
regionKey This property is required. String
The region key. See the full region list.
zoneId This property is required. String
The zone identifier to target for the resource.
hostname This property is required. string
The hostname to regionalize.
regionKey This property is required. string
The region key. See the full region list.
zoneId This property is required. string
The zone identifier to target for the resource.
hostname This property is required. str
The hostname to regionalize.
region_key This property is required. str
The region key. See the full region list.
zone_id This property is required. str
The zone identifier to target for the resource.
hostname This property is required. String
The hostname to regionalize.
regionKey This property is required. String
The region key. See the full region list.
zoneId This property is required. String
The zone identifier to target for the resource.

Outputs

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

CreatedOn string
The RFC3339 timestamp of when the hostname was created.
Id string
The provider-assigned unique ID for this managed resource.
CreatedOn string
The RFC3339 timestamp of when the hostname was created.
Id string
The provider-assigned unique ID for this managed resource.
createdOn String
The RFC3339 timestamp of when the hostname was created.
id String
The provider-assigned unique ID for this managed resource.
createdOn string
The RFC3339 timestamp of when the hostname was created.
id string
The provider-assigned unique ID for this managed resource.
created_on str
The RFC3339 timestamp of when the hostname was created.
id str
The provider-assigned unique ID for this managed resource.
createdOn String
The RFC3339 timestamp of when the hostname was created.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing RegionalHostname Resource

Get an existing RegionalHostname 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?: RegionalHostnameState, opts?: CustomResourceOptions): RegionalHostname
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_on: Optional[str] = None,
        hostname: Optional[str] = None,
        region_key: Optional[str] = None,
        zone_id: Optional[str] = None) -> RegionalHostname
func GetRegionalHostname(ctx *Context, name string, id IDInput, state *RegionalHostnameState, opts ...ResourceOption) (*RegionalHostname, error)
public static RegionalHostname Get(string name, Input<string> id, RegionalHostnameState? state, CustomResourceOptions? opts = null)
public static RegionalHostname get(String name, Output<String> id, RegionalHostnameState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:RegionalHostname    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:
CreatedOn string
The RFC3339 timestamp of when the hostname was created.
Hostname string
The hostname to regionalize.
RegionKey string
The region key. See the full region list.
ZoneId string
The zone identifier to target for the resource.
CreatedOn string
The RFC3339 timestamp of when the hostname was created.
Hostname string
The hostname to regionalize.
RegionKey string
The region key. See the full region list.
ZoneId string
The zone identifier to target for the resource.
createdOn String
The RFC3339 timestamp of when the hostname was created.
hostname String
The hostname to regionalize.
regionKey String
The region key. See the full region list.
zoneId String
The zone identifier to target for the resource.
createdOn string
The RFC3339 timestamp of when the hostname was created.
hostname string
The hostname to regionalize.
regionKey string
The region key. See the full region list.
zoneId string
The zone identifier to target for the resource.
created_on str
The RFC3339 timestamp of when the hostname was created.
hostname str
The hostname to regionalize.
region_key str
The region key. See the full region list.
zone_id str
The zone identifier to target for the resource.
createdOn String
The RFC3339 timestamp of when the hostname was created.
hostname String
The hostname to regionalize.
regionKey String
The region key. See the full region list.
zoneId String
The zone identifier to target for the resource.

Package Details

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