1. Packages
  2. Packages
  3. Cloudflare Provider
  4. API Docs
  5. CertificateAuthoritiesHostnameAssociations
Viewing docs for Cloudflare v6.15.0
published on Saturday, May 2, 2026 by Pulumi
cloudflare logo
Viewing docs for Cloudflare v6.15.0
published on Saturday, May 2, 2026 by Pulumi

    Accepted Permissions

    • SSL and Certificates Read
    • SSL and Certificates Write

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const exampleCertificateAuthoritiesHostnameAssociations = new cloudflare.CertificateAuthoritiesHostnameAssociations("example_certificate_authorities_hostname_associations", {
        zoneId: "023e105f4ecef8ad9ca31a8372d0c353",
        hostnames: ["api.example.com"],
        mtlsCertificateId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example_certificate_authorities_hostname_associations = cloudflare.CertificateAuthoritiesHostnameAssociations("example_certificate_authorities_hostname_associations",
        zone_id="023e105f4ecef8ad9ca31a8372d0c353",
        hostnames=["api.example.com"],
        mtls_certificate_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
    
    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.NewCertificateAuthoritiesHostnameAssociations(ctx, "example_certificate_authorities_hostname_associations", &cloudflare.CertificateAuthoritiesHostnameAssociationsArgs{
    			ZoneId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
    			Hostnames: pulumi.StringArray{
    				pulumi.String("api.example.com"),
    			},
    			MtlsCertificateId: pulumi.String("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"),
    		})
    		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 exampleCertificateAuthoritiesHostnameAssociations = new Cloudflare.Index.CertificateAuthoritiesHostnameAssociations("example_certificate_authorities_hostname_associations", new()
        {
            ZoneId = "023e105f4ecef8ad9ca31a8372d0c353",
            Hostnames = new[]
            {
                "api.example.com",
            },
            MtlsCertificateId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.CertificateAuthoritiesHostnameAssociations;
    import com.pulumi.cloudflare.CertificateAuthoritiesHostnameAssociationsArgs;
    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 exampleCertificateAuthoritiesHostnameAssociations = new CertificateAuthoritiesHostnameAssociations("exampleCertificateAuthoritiesHostnameAssociations", CertificateAuthoritiesHostnameAssociationsArgs.builder()
                .zoneId("023e105f4ecef8ad9ca31a8372d0c353")
                .hostnames("api.example.com")
                .mtlsCertificateId("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
                .build());
    
        }
    }
    
    resources:
      exampleCertificateAuthoritiesHostnameAssociations:
        type: cloudflare:CertificateAuthoritiesHostnameAssociations
        name: example_certificate_authorities_hostname_associations
        properties:
          zoneId: 023e105f4ecef8ad9ca31a8372d0c353
          hostnames:
            - api.example.com
          mtlsCertificateId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    

    Create CertificateAuthoritiesHostnameAssociations Resource

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

    Constructor syntax

    new CertificateAuthoritiesHostnameAssociations(name: string, args: CertificateAuthoritiesHostnameAssociationsArgs, opts?: CustomResourceOptions);
    @overload
    def CertificateAuthoritiesHostnameAssociations(resource_name: str,
                                                   args: CertificateAuthoritiesHostnameAssociationsArgs,
                                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def CertificateAuthoritiesHostnameAssociations(resource_name: str,
                                                   opts: Optional[ResourceOptions] = None,
                                                   zone_id: Optional[str] = None,
                                                   hostnames: Optional[Sequence[str]] = None,
                                                   mtls_certificate_id: Optional[str] = None)
    func NewCertificateAuthoritiesHostnameAssociations(ctx *Context, name string, args CertificateAuthoritiesHostnameAssociationsArgs, opts ...ResourceOption) (*CertificateAuthoritiesHostnameAssociations, error)
    public CertificateAuthoritiesHostnameAssociations(string name, CertificateAuthoritiesHostnameAssociationsArgs args, CustomResourceOptions? opts = null)
    public CertificateAuthoritiesHostnameAssociations(String name, CertificateAuthoritiesHostnameAssociationsArgs args)
    public CertificateAuthoritiesHostnameAssociations(String name, CertificateAuthoritiesHostnameAssociationsArgs args, CustomResourceOptions options)
    
    type: cloudflare:CertificateAuthoritiesHostnameAssociations
    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 CertificateAuthoritiesHostnameAssociationsArgs
    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 CertificateAuthoritiesHostnameAssociationsArgs
    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 CertificateAuthoritiesHostnameAssociationsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CertificateAuthoritiesHostnameAssociationsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CertificateAuthoritiesHostnameAssociationsArgs
    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 certificateAuthoritiesHostnameAssociationsResource = new Cloudflare.CertificateAuthoritiesHostnameAssociations("certificateAuthoritiesHostnameAssociationsResource", new()
    {
        ZoneId = "string",
        Hostnames = new[]
        {
            "string",
        },
        MtlsCertificateId = "string",
    });
    
    example, err := cloudflare.NewCertificateAuthoritiesHostnameAssociations(ctx, "certificateAuthoritiesHostnameAssociationsResource", &cloudflare.CertificateAuthoritiesHostnameAssociationsArgs{
    	ZoneId: pulumi.String("string"),
    	Hostnames: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	MtlsCertificateId: pulumi.String("string"),
    })
    
    var certificateAuthoritiesHostnameAssociationsResource = new CertificateAuthoritiesHostnameAssociations("certificateAuthoritiesHostnameAssociationsResource", CertificateAuthoritiesHostnameAssociationsArgs.builder()
        .zoneId("string")
        .hostnames("string")
        .mtlsCertificateId("string")
        .build());
    
    certificate_authorities_hostname_associations_resource = cloudflare.CertificateAuthoritiesHostnameAssociations("certificateAuthoritiesHostnameAssociationsResource",
        zone_id="string",
        hostnames=["string"],
        mtls_certificate_id="string")
    
    const certificateAuthoritiesHostnameAssociationsResource = new cloudflare.CertificateAuthoritiesHostnameAssociations("certificateAuthoritiesHostnameAssociationsResource", {
        zoneId: "string",
        hostnames: ["string"],
        mtlsCertificateId: "string",
    });
    
    type: cloudflare:CertificateAuthoritiesHostnameAssociations
    properties:
        hostnames:
            - string
        mtlsCertificateId: string
        zoneId: string
    

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

    ZoneId string
    Identifier.
    Hostnames List<string>
    MtlsCertificateId string
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    ZoneId string
    Identifier.
    Hostnames []string
    MtlsCertificateId string
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    zoneId String
    Identifier.
    hostnames List<String>
    mtlsCertificateId String
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    zoneId string
    Identifier.
    hostnames string[]
    mtlsCertificateId string
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    zone_id str
    Identifier.
    hostnames Sequence[str]
    mtls_certificate_id str
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    zoneId String
    Identifier.
    hostnames List<String>
    mtlsCertificateId String
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CertificateAuthoritiesHostnameAssociations 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 CertificateAuthoritiesHostnameAssociations Resource

    Get an existing CertificateAuthoritiesHostnameAssociations 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?: CertificateAuthoritiesHostnameAssociationsState, opts?: CustomResourceOptions): CertificateAuthoritiesHostnameAssociations
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            hostnames: Optional[Sequence[str]] = None,
            mtls_certificate_id: Optional[str] = None,
            zone_id: Optional[str] = None) -> CertificateAuthoritiesHostnameAssociations
    func GetCertificateAuthoritiesHostnameAssociations(ctx *Context, name string, id IDInput, state *CertificateAuthoritiesHostnameAssociationsState, opts ...ResourceOption) (*CertificateAuthoritiesHostnameAssociations, error)
    public static CertificateAuthoritiesHostnameAssociations Get(string name, Input<string> id, CertificateAuthoritiesHostnameAssociationsState? state, CustomResourceOptions? opts = null)
    public static CertificateAuthoritiesHostnameAssociations get(String name, Output<String> id, CertificateAuthoritiesHostnameAssociationsState state, CustomResourceOptions options)
    resources:  _:    type: cloudflare:CertificateAuthoritiesHostnameAssociations    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:
    Hostnames List<string>
    MtlsCertificateId string
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    ZoneId string
    Identifier.
    Hostnames []string
    MtlsCertificateId string
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    ZoneId string
    Identifier.
    hostnames List<String>
    mtlsCertificateId String
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    zoneId String
    Identifier.
    hostnames string[]
    mtlsCertificateId string
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    zoneId string
    Identifier.
    hostnames Sequence[str]
    mtls_certificate_id str
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    zone_id str
    Identifier.
    hostnames List<String>
    mtlsCertificateId String
    The UUID for a certificate that was uploaded to the mTLS Certificate Management endpoint. If no mtlscertificateid is given, the hostnames will be associated to your active Cloudflare Managed CA.
    zoneId String
    Identifier.

    Import

    $ pulumi import cloudflare:index/certificateAuthoritiesHostnameAssociations:CertificateAuthoritiesHostnameAssociations example '<zone_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
    Viewing docs for Cloudflare v6.15.0
    published on Saturday, May 2, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.