Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

CustomHostname

Provides a Cloudflare custom hostname (also known as SSL for SaaS) resource.

Example Usage

using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleHostname = new Cloudflare.CustomHostname("exampleHostname", new Cloudflare.CustomHostnameArgs
        {
            Hostname = "hostname.example.com",
            Ssls = 
            {
                new Cloudflare.Inputs.CustomHostnameSslArgs
                {
                    Method = "txt",
                },
            },
            ZoneId = "d41d8cd98f00b204e9800998ecf8427e",
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := cloudflare.NewCustomHostname(ctx, "exampleHostname", &cloudflare.CustomHostnameArgs{
            Hostname: pulumi.String("hostname.example.com"),
            Ssls: cloudflare.CustomHostnameSslArray{
                &cloudflare.CustomHostnameSslArgs{
                    Method: pulumi.String("txt"),
                },
            },
            ZoneId: pulumi.String("d41d8cd98f00b204e9800998ecf8427e"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_cloudflare as cloudflare

example_hostname = cloudflare.CustomHostname("exampleHostname",
    hostname="hostname.example.com",
    ssls=[cloudflare.CustomHostnameSslArgs(
        method="txt",
    )],
    zone_id="d41d8cd98f00b204e9800998ecf8427e")
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const exampleHostname = new cloudflare.CustomHostname("example_hostname", {
    hostname: "hostname.example.com",
    ssls: [{
        method: "txt",
    }],
    zoneId: "d41d8cd98f00b204e9800998ecf8427e",
});

Create a CustomHostname Resource

new CustomHostname(name: string, args: CustomHostnameArgs, opts?: CustomResourceOptions);
def CustomHostname(resource_name: str, opts: Optional[ResourceOptions] = None, custom_origin_server: Optional[str] = None, hostname: Optional[str] = None, ssls: Optional[Sequence[CustomHostnameSslArgs]] = None, zone_id: Optional[str] = None)
func NewCustomHostname(ctx *Context, name string, args CustomHostnameArgs, opts ...ResourceOption) (*CustomHostname, error)
public CustomHostname(string name, CustomHostnameArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args CustomHostnameArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CustomHostnameArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CustomHostnameArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

CustomHostname Resource Properties

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

Inputs

The CustomHostname resource accepts the following input properties:

Hostname string

Hostname you intend to request a certificate for.

Ssls List<CustomHostnameSslArgs>

SSL configuration of the certificate. See further notes below.

ZoneId string

The DNS zone ID where the custom hostname should be assigned.

CustomOriginServer string

The custom origin server used for certificates.

Hostname string

Hostname you intend to request a certificate for.

Ssls []CustomHostnameSsl

SSL configuration of the certificate. See further notes below.

ZoneId string

The DNS zone ID where the custom hostname should be assigned.

CustomOriginServer string

The custom origin server used for certificates.

hostname string

Hostname you intend to request a certificate for.

ssls CustomHostnameSsl[]

SSL configuration of the certificate. See further notes below.

zoneId string

The DNS zone ID where the custom hostname should be assigned.

customOriginServer string

The custom origin server used for certificates.

hostname str

Hostname you intend to request a certificate for.

ssls Sequence[CustomHostnameSslArgs]

SSL configuration of the certificate. See further notes below.

zone_id str

The DNS zone ID where the custom hostname should be assigned.

custom_origin_server str

The custom origin server used for certificates.

Outputs

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

Look up an Existing CustomHostname Resource

Get an existing CustomHostname 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?: CustomHostnameState, opts?: CustomResourceOptions): CustomHostname
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, custom_origin_server: Optional[str] = None, hostname: Optional[str] = None, ownership_verification: Optional[CustomHostnameOwnershipVerificationArgs] = None, ownership_verification_http: Optional[CustomHostnameOwnershipVerificationHttpArgs] = None, ssls: Optional[Sequence[CustomHostnameSslArgs]] = None, status: Optional[str] = None, zone_id: Optional[str] = None) -> CustomHostname
func GetCustomHostname(ctx *Context, name string, id IDInput, state *CustomHostnameState, opts ...ResourceOption) (*CustomHostname, error)
public static CustomHostname Get(string name, Input<string> id, CustomHostnameState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

CustomOriginServer string

The custom origin server used for certificates.

Hostname string

Hostname you intend to request a certificate for.

OwnershipVerification CustomHostnameOwnershipVerificationArgs
OwnershipVerificationHttp CustomHostnameOwnershipVerificationHttpArgs
Ssls List<CustomHostnameSslArgs>

SSL configuration of the certificate. See further notes below.

Status string
ZoneId string

The DNS zone ID where the custom hostname should be assigned.

CustomOriginServer string

The custom origin server used for certificates.

Hostname string

Hostname you intend to request a certificate for.

OwnershipVerification CustomHostnameOwnershipVerification
OwnershipVerificationHttp CustomHostnameOwnershipVerificationHttp
Ssls []CustomHostnameSsl

SSL configuration of the certificate. See further notes below.

Status string
ZoneId string

The DNS zone ID where the custom hostname should be assigned.

customOriginServer string

The custom origin server used for certificates.

hostname string

Hostname you intend to request a certificate for.

ownershipVerification CustomHostnameOwnershipVerification
ownershipVerificationHttp CustomHostnameOwnershipVerificationHttp
ssls CustomHostnameSsl[]

SSL configuration of the certificate. See further notes below.

status string
zoneId string

The DNS zone ID where the custom hostname should be assigned.

custom_origin_server str

The custom origin server used for certificates.

hostname str

Hostname you intend to request a certificate for.

ownership_verification CustomHostnameOwnershipVerificationArgs
ownership_verification_http CustomHostnameOwnershipVerificationHttpArgs
ssls Sequence[CustomHostnameSslArgs]

SSL configuration of the certificate. See further notes below.

status str
zone_id str

The DNS zone ID where the custom hostname should be assigned.

Supporting Types

CustomHostnameOwnershipVerification

Name string
Type string

Level of validation to be used for this hostname. Domain validation (“dv”) must be used.

Value string
Name string
Type string

Level of validation to be used for this hostname. Domain validation (“dv”) must be used.

Value string
name string
type string

Level of validation to be used for this hostname. Domain validation (“dv”) must be used.

value string
name str
type str

Level of validation to be used for this hostname. Domain validation (“dv”) must be used.

value str

CustomHostnameOwnershipVerificationHttp

HttpBody string
HttpUrl string
HttpBody string
HttpUrl string
httpBody string
httpUrl string

CustomHostnameSsl

CertificateAuthority string
CnameName string
CnameTarget string
CustomCertificate string

If a custom uploaded certificate is used.

CustomKey string

The key for a custom uploaded certificate.

Method string

Domain control validation (DCV) method used for this hostname. Valid values are "txt", "http" and "email".

Settings List<CustomHostnameSslSettingArgs>

SSL/TLS settings for the certificate. See further notes below.

Status string
Type string

Level of validation to be used for this hostname. Domain validation (“dv”) must be used.

Wildcard bool

Indicates whether the certificate covers a wildcard.

CertificateAuthority string
CnameName string
CnameTarget string
CustomCertificate string

If a custom uploaded certificate is used.

CustomKey string

The key for a custom uploaded certificate.

Method string

Domain control validation (DCV) method used for this hostname. Valid values are "txt", "http" and "email".

Settings []CustomHostnameSslSetting

SSL/TLS settings for the certificate. See further notes below.

Status string
Type string

Level of validation to be used for this hostname. Domain validation (“dv”) must be used.

Wildcard bool

Indicates whether the certificate covers a wildcard.

certificateAuthority string
cnameName string
cnameTarget string
customCertificate string

If a custom uploaded certificate is used.

customKey string

The key for a custom uploaded certificate.

method string

Domain control validation (DCV) method used for this hostname. Valid values are "txt", "http" and "email".

settings CustomHostnameSslSetting[]

SSL/TLS settings for the certificate. See further notes below.

status string
type string

Level of validation to be used for this hostname. Domain validation (“dv”) must be used.

wildcard boolean

Indicates whether the certificate covers a wildcard.

certificate_authority str
cname_name str
cname_target str
custom_certificate str

If a custom uploaded certificate is used.

custom_key str

The key for a custom uploaded certificate.

method str

Domain control validation (DCV) method used for this hostname. Valid values are "txt", "http" and "email".

settings Sequence[CustomHostnameSslSettingArgs]

SSL/TLS settings for the certificate. See further notes below.

status str
type str

Level of validation to be used for this hostname. Domain validation (“dv”) must be used.

wildcard bool

Indicates whether the certificate covers a wildcard.

CustomHostnameSslSetting

Ciphers List<string>

List of SSL/TLS ciphers to associate with this certificate.

Http2 string

Whether or not HTTP2 should be supported. Valid values are "on" or "off".

MinTlsVersion string

Lowest version of TLS this certificate should support. Valid values are "1.0", "1.1", "1.2" and "1.3".

Tls13 string

Whether or not TLSv1.3 should be supported. Valid values are "on" or "off".

Ciphers []string

List of SSL/TLS ciphers to associate with this certificate.

Http2 string

Whether or not HTTP2 should be supported. Valid values are "on" or "off".

MinTlsVersion string

Lowest version of TLS this certificate should support. Valid values are "1.0", "1.1", "1.2" and "1.3".

Tls13 string

Whether or not TLSv1.3 should be supported. Valid values are "on" or "off".

ciphers string[]

List of SSL/TLS ciphers to associate with this certificate.

http2 string

Whether or not HTTP2 should be supported. Valid values are "on" or "off".

minTlsVersion string

Lowest version of TLS this certificate should support. Valid values are "1.0", "1.1", "1.2" and "1.3".

tls13 string

Whether or not TLSv1.3 should be supported. Valid values are "on" or "off".

ciphers Sequence[str]

List of SSL/TLS ciphers to associate with this certificate.

http2 str

Whether or not HTTP2 should be supported. Valid values are "on" or "off".

min_tls_version str

Lowest version of TLS this certificate should support. Valid values are "1.0", "1.1", "1.2" and "1.3".

tls13 str

Whether or not TLSv1.3 should be supported. Valid values are "on" or "off".

Import

Custom hostname certificates can be imported using a composite ID formed of the zone ID and hostname ID, separated by a “/” e.g.

 $ pulumi import cloudflare:index/customHostname:CustomHostname example d41d8cd98f00b204e9800998ecf8427e/0d89c70d-ad9f-4843-b99f-6cc0252067e9

Package Details

Repository
https://github.com/pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.