Cloudflare

v4.12.1 published on Thursday, Sep 22, 2022 by Pulumi

CustomHostname

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

Example Usage

using System.Collections.Generic;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var example = new Cloudflare.CustomHostname("example", new()
    {
        Hostname = "hostname.example.com",
        Ssls = new[]
        {
            new Cloudflare.Inputs.CustomHostnameSslArgs
            {
                Method = "txt",
            },
        },
        ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewCustomHostname(ctx, "example", &cloudflare.CustomHostnameArgs{
			Hostname: pulumi.String("hostname.example.com"),
			Ssls: CustomHostnameSslArray{
				&CustomHostnameSslArgs{
					Method: pulumi.String("txt"),
				},
			},
			ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.CustomHostname;
import com.pulumi.cloudflare.CustomHostnameArgs;
import com.pulumi.cloudflare.inputs.CustomHostnameSslArgs;
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 example = new CustomHostname("example", CustomHostnameArgs.builder()        
            .hostname("hostname.example.com")
            .ssls(CustomHostnameSslArgs.builder()
                .method("txt")
                .build())
            .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
            .build());

    }
}
import pulumi
import pulumi_cloudflare as cloudflare

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

const example = new cloudflare.CustomHostname("example", {
    hostname: "hostname.example.com",
    ssls: [{
        method: "txt",
    }],
    zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
});
resources:
  example:
    type: cloudflare:CustomHostname
    properties:
      hostname: hostname.example.com
      ssls:
        - method: txt
      zoneId: 0da42c8d2132a9ddaf714f9e7c920711

Create a CustomHostname Resource

new CustomHostname(name: string, args: CustomHostnameArgs, opts?: CustomResourceOptions);
@overload
def CustomHostname(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   custom_origin_server: Optional[str] = None,
                   custom_origin_sni: Optional[str] = None,
                   hostname: Optional[str] = None,
                   ssls: Optional[Sequence[CustomHostnameSslArgs]] = None,
                   zone_id: Optional[str] = None)
@overload
def CustomHostname(resource_name: str,
                   args: CustomHostnameArgs,
                   opts: Optional[ResourceOptions] = None)
func NewCustomHostname(ctx *Context, name string, args CustomHostnameArgs, opts ...ResourceOption) (*CustomHostname, error)
public CustomHostname(string name, CustomHostnameArgs args, CustomResourceOptions? opts = null)
public CustomHostname(String name, CustomHostnameArgs args)
public CustomHostname(String name, CustomHostnameArgs args, CustomResourceOptions options)
type: cloudflare:CustomHostname
properties: # The arguments to resource properties.
options: # 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.
resource_name str
The unique name of the resource.
args CustomHostnameArgs
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 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.
name String
The unique name of the resource.
args CustomHostnameArgs
The arguments to resource properties.
options 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 Architecture and Concepts docs.

Inputs

The CustomHostname resource accepts the following input properties:

Hostname string

Hostname you intend to request a certificate for.

ZoneId string

The zone identifier to target for the resource.

CustomOriginServer string

The custom origin server used for certificates.

CustomOriginSni string

The custom origin SNI used for certificates.

Ssls List<CustomHostnameSslArgs>

SSL configuration of the certificate.

Hostname string

Hostname you intend to request a certificate for.

ZoneId string

The zone identifier to target for the resource.

CustomOriginServer string

The custom origin server used for certificates.

CustomOriginSni string

The custom origin SNI used for certificates.

Ssls []CustomHostnameSslArgs

SSL configuration of the certificate.

hostname String

Hostname you intend to request a certificate for.

zoneId String

The zone identifier to target for the resource.

customOriginServer String

The custom origin server used for certificates.

customOriginSni String

The custom origin SNI used for certificates.

ssls List<CustomHostnameSslArgs>

SSL configuration of the certificate.

hostname string

Hostname you intend to request a certificate for.

zoneId string

The zone identifier to target for the resource.

customOriginServer string

The custom origin server used for certificates.

customOriginSni string

The custom origin SNI used for certificates.

ssls CustomHostnameSslArgs[]

SSL configuration of the certificate.

hostname str

Hostname you intend to request a certificate for.

zone_id str

The zone identifier to target for the resource.

custom_origin_server str

The custom origin server used for certificates.

custom_origin_sni str

The custom origin SNI used for certificates.

ssls Sequence[CustomHostnameSslArgs]

SSL configuration of the certificate.

hostname String

Hostname you intend to request a certificate for.

zoneId String

The zone identifier to target for the resource.

customOriginServer String

The custom origin server used for certificates.

customOriginSni String

The custom origin SNI used for certificates.

ssls List<Property Map>

SSL configuration of the certificate.

Outputs

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

Id string

The provider-assigned unique ID for this managed resource.

OwnershipVerification Dictionary<string, string>
OwnershipVerificationHttp Dictionary<string, string>
Status string

Status of the certificate.

Id string

The provider-assigned unique ID for this managed resource.

OwnershipVerification map[string]string
OwnershipVerificationHttp map[string]string
Status string

Status of the certificate.

id String

The provider-assigned unique ID for this managed resource.

ownershipVerification Map<String,String>
ownershipVerificationHttp Map<String,String>
status String

Status of the certificate.

id string

The provider-assigned unique ID for this managed resource.

ownershipVerification {[key: string]: string}
ownershipVerificationHttp {[key: string]: string}
status string

Status of the certificate.

id str

The provider-assigned unique ID for this managed resource.

ownership_verification Mapping[str, str]
ownership_verification_http Mapping[str, str]
status str

Status of the certificate.

id String

The provider-assigned unique ID for this managed resource.

ownershipVerification Map<String>
ownershipVerificationHttp Map<String>
status String

Status of the certificate.

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,
        custom_origin_sni: Optional[str] = None,
        hostname: Optional[str] = None,
        ownership_verification: Optional[Mapping[str, str]] = None,
        ownership_verification_http: Optional[Mapping[str, str]] = 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)
public static CustomHostname get(String name, Output<String> id, CustomHostnameState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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:
CustomOriginServer string

The custom origin server used for certificates.

CustomOriginSni string

The custom origin SNI used for certificates.

Hostname string

Hostname you intend to request a certificate for.

OwnershipVerification Dictionary<string, string>
OwnershipVerificationHttp Dictionary<string, string>
Ssls List<CustomHostnameSslArgs>

SSL configuration of the certificate.

Status string

Status of the certificate.

ZoneId string

The zone identifier to target for the resource.

CustomOriginServer string

The custom origin server used for certificates.

CustomOriginSni string

The custom origin SNI used for certificates.

Hostname string

Hostname you intend to request a certificate for.

OwnershipVerification map[string]string
OwnershipVerificationHttp map[string]string
Ssls []CustomHostnameSslArgs

SSL configuration of the certificate.

Status string

Status of the certificate.

ZoneId string

The zone identifier to target for the resource.

customOriginServer String

The custom origin server used for certificates.

customOriginSni String

The custom origin SNI used for certificates.

hostname String

Hostname you intend to request a certificate for.

ownershipVerification Map<String,String>
ownershipVerificationHttp Map<String,String>
ssls List<CustomHostnameSslArgs>

SSL configuration of the certificate.

status String

Status of the certificate.

zoneId String

The zone identifier to target for the resource.

customOriginServer string

The custom origin server used for certificates.

customOriginSni string

The custom origin SNI used for certificates.

hostname string

Hostname you intend to request a certificate for.

ownershipVerification {[key: string]: string}
ownershipVerificationHttp {[key: string]: string}
ssls CustomHostnameSslArgs[]

SSL configuration of the certificate.

status string

Status of the certificate.

zoneId string

The zone identifier to target for the resource.

custom_origin_server str

The custom origin server used for certificates.

custom_origin_sni str

The custom origin SNI used for certificates.

hostname str

Hostname you intend to request a certificate for.

ownership_verification Mapping[str, str]
ownership_verification_http Mapping[str, str]
ssls Sequence[CustomHostnameSslArgs]

SSL configuration of the certificate.

status str

Status of the certificate.

zone_id str

The zone identifier to target for the resource.

customOriginServer String

The custom origin server used for certificates.

customOriginSni String

The custom origin SNI used for certificates.

hostname String

Hostname you intend to request a certificate for.

ownershipVerification Map<String>
ownershipVerificationHttp Map<String>
ssls List<Property Map>

SSL configuration of the certificate.

status String

Status of the certificate.

zoneId String

The zone identifier to target for the resource.

Supporting Types

CustomHostnameSsl

CertificateAuthority 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. Available values: http, txt, email.

Settings List<CustomHostnameSslSetting>

SSL/TLS settings for the certificate.

Status string

Status of the certificate.

Type string

Level of validation to be used for this hostname. Available values: dv. Defaults to dv.

ValidationErrors List<CustomHostnameSslValidationError>
ValidationRecords List<CustomHostnameSslValidationRecord>
Wildcard bool

Indicates whether the certificate covers a wildcard.

CertificateAuthority 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. Available values: http, txt, email.

Settings []CustomHostnameSslSetting

SSL/TLS settings for the certificate.

Status string

Status of the certificate.

Type string

Level of validation to be used for this hostname. Available values: dv. Defaults to dv.

ValidationErrors []CustomHostnameSslValidationError
ValidationRecords []CustomHostnameSslValidationRecord
Wildcard bool

Indicates whether the certificate covers a wildcard.

certificateAuthority 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. Available values: http, txt, email.

settings List<CustomHostnameSslSetting>

SSL/TLS settings for the certificate.

status String

Status of the certificate.

type String

Level of validation to be used for this hostname. Available values: dv. Defaults to dv.

validationErrors List<CustomHostnameSslValidationError>
validationRecords List<CustomHostnameSslValidationRecord>
wildcard Boolean

Indicates whether the certificate covers a wildcard.

certificateAuthority 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. Available values: http, txt, email.

settings CustomHostnameSslSetting[]

SSL/TLS settings for the certificate.

status string

Status of the certificate.

type string

Level of validation to be used for this hostname. Available values: dv. Defaults to dv.

validationErrors CustomHostnameSslValidationError[]
validationRecords CustomHostnameSslValidationRecord[]
wildcard boolean

Indicates whether the certificate covers a wildcard.

certificate_authority 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. Available values: http, txt, email.

settings Sequence[CustomHostnameSslSetting]

SSL/TLS settings for the certificate.

status str

Status of the certificate.

type str

Level of validation to be used for this hostname. Available values: dv. Defaults to dv.

validation_errors Sequence[CustomHostnameSslValidationError]
validation_records Sequence[CustomHostnameSslValidationRecord]
wildcard bool

Indicates whether the certificate covers a wildcard.

certificateAuthority 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. Available values: http, txt, email.

settings List<Property Map>

SSL/TLS settings for the certificate.

status String

Status of the certificate.

type String

Level of validation to be used for this hostname. Available values: dv. Defaults to dv.

validationErrors List<Property Map>
validationRecords List<Property Map>
wildcard Boolean

Indicates whether the certificate covers a wildcard.

CustomHostnameSslSetting

Ciphers List<string>
EarlyHints string
Http2 string
MinTlsVersion string
Tls13 string
Ciphers []string
EarlyHints string
Http2 string
MinTlsVersion string
Tls13 string
ciphers List<String>
earlyHints String
http2 String
minTlsVersion String
tls13 String
ciphers string[]
earlyHints string
http2 string
minTlsVersion string
tls13 string
ciphers Sequence[str]
early_hints str
http2 str
min_tls_version str
tls13 str
ciphers List<String>
earlyHints String
http2 String
minTlsVersion String
tls13 String

CustomHostnameSslValidationError

Message string
Message string
message String
message string
message String

CustomHostnameSslValidationRecord

CnameName string
CnameTarget string
Emails List<string>
HttpBody string
HttpUrl string
TxtName string
TxtValue string
CnameName string
CnameTarget string
Emails []string
HttpBody string
HttpUrl string
TxtName string
TxtValue string
cnameName String
cnameTarget String
emails List<String>
httpBody String
httpUrl String
txtName String
txtValue String
cnameName string
cnameTarget string
emails string[]
httpBody string
httpUrl string
txtName string
txtValue string
cnameName String
cnameTarget String
emails List<String>
httpBody String
httpUrl String
txtName String
txtValue String

Import

 $ pulumi import cloudflare:index/customHostname:CustomHostname example 1d5fdc9e88c8a8c4518b068cd94331fe/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.