1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. MtlsCertificate
Cloudflare v5.43.0 published on Wednesday, Nov 13, 2024 by Pulumi

cloudflare.MtlsCertificate

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.43.0 published on Wednesday, Nov 13, 2024 by Pulumi

    Provides a Cloudflare mTLS certificate resource. These certificates may be used with mTLS enabled Cloudflare services.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const example = new cloudflare.MtlsCertificate("example", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        name: "example",
        certificates: `-----BEGIN CERTIFICATE-----
    MIIDmDCCAoCgAwIBAgIUKTOAZNj...i4JhqeoTewsxndhDDE
    -----END CERTIFICATE-----`,
        privateKey: `-----BEGIN PRIVATE KEY-----
    MIIEvQIBADANBgkqhkiG9w0BAQE...1IS3EnQRrz6WMYA=
    -----END PRIVATE KEY-----`,
        ca: true,
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example = cloudflare.MtlsCertificate("example",
        account_id="f037e56e89293a057740de681ac9abbe",
        name="example",
        certificates="""-----BEGIN CERTIFICATE-----
    MIIDmDCCAoCgAwIBAgIUKTOAZNj...i4JhqeoTewsxndhDDE
    -----END CERTIFICATE-----""",
        private_key="""-----BEGIN PRIVATE KEY-----
    MIIEvQIBADANBgkqhkiG9w0BAQE...1IS3EnQRrz6WMYA=
    -----END PRIVATE KEY-----""",
        ca=True)
    
    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 {
    		_, err := cloudflare.NewMtlsCertificate(ctx, "example", &cloudflare.MtlsCertificateArgs{
    			AccountId:    pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			Name:         pulumi.String("example"),
    			Certificates: pulumi.String("-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNj...i4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----"),
    			PrivateKey:   pulumi.String("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQE...1IS3EnQRrz6WMYA=\n-----END PRIVATE KEY-----"),
    			Ca:           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 example = new Cloudflare.MtlsCertificate("example", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            Name = "example",
            Certificates = @"-----BEGIN CERTIFICATE-----
    MIIDmDCCAoCgAwIBAgIUKTOAZNj...i4JhqeoTewsxndhDDE
    -----END CERTIFICATE-----",
            PrivateKey = @"-----BEGIN PRIVATE KEY-----
    MIIEvQIBADANBgkqhkiG9w0BAQE...1IS3EnQRrz6WMYA=
    -----END PRIVATE KEY-----",
            Ca = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cloudflare.MtlsCertificate;
    import com.pulumi.cloudflare.MtlsCertificateArgs;
    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 MtlsCertificate("example", MtlsCertificateArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .name("example")
                .certificates("""
    -----BEGIN CERTIFICATE-----
    MIIDmDCCAoCgAwIBAgIUKTOAZNj...i4JhqeoTewsxndhDDE
    -----END CERTIFICATE-----            """)
                .privateKey("""
    -----BEGIN PRIVATE KEY-----
    MIIEvQIBADANBgkqhkiG9w0BAQE...1IS3EnQRrz6WMYA=
    -----END PRIVATE KEY-----            """)
                .ca(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: cloudflare:MtlsCertificate
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          name: example
          certificates: |-
            -----BEGIN CERTIFICATE-----
            MIIDmDCCAoCgAwIBAgIUKTOAZNj...i4JhqeoTewsxndhDDE
            -----END CERTIFICATE-----        
          privateKey: |-
            -----BEGIN PRIVATE KEY-----
            MIIEvQIBADANBgkqhkiG9w0BAQE...1IS3EnQRrz6WMYA=
            -----END PRIVATE KEY-----        
          ca: true
    

    Create MtlsCertificate Resource

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

    Constructor syntax

    new MtlsCertificate(name: string, args: MtlsCertificateArgs, opts?: CustomResourceOptions);
    @overload
    def MtlsCertificate(resource_name: str,
                        args: MtlsCertificateArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def MtlsCertificate(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        account_id: Optional[str] = None,
                        ca: Optional[bool] = None,
                        certificates: Optional[str] = None,
                        name: Optional[str] = None,
                        private_key: Optional[str] = None)
    func NewMtlsCertificate(ctx *Context, name string, args MtlsCertificateArgs, opts ...ResourceOption) (*MtlsCertificate, error)
    public MtlsCertificate(string name, MtlsCertificateArgs args, CustomResourceOptions? opts = null)
    public MtlsCertificate(String name, MtlsCertificateArgs args)
    public MtlsCertificate(String name, MtlsCertificateArgs args, CustomResourceOptions options)
    
    type: cloudflare:MtlsCertificate
    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 MtlsCertificateArgs
    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 MtlsCertificateArgs
    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 MtlsCertificateArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MtlsCertificateArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MtlsCertificateArgs
    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 mtlsCertificateResource = new Cloudflare.MtlsCertificate("mtlsCertificateResource", new()
    {
        AccountId = "string",
        Ca = false,
        Certificates = "string",
        Name = "string",
        PrivateKey = "string",
    });
    
    example, err := cloudflare.NewMtlsCertificate(ctx, "mtlsCertificateResource", &cloudflare.MtlsCertificateArgs{
    	AccountId:    pulumi.String("string"),
    	Ca:           pulumi.Bool(false),
    	Certificates: pulumi.String("string"),
    	Name:         pulumi.String("string"),
    	PrivateKey:   pulumi.String("string"),
    })
    
    var mtlsCertificateResource = new MtlsCertificate("mtlsCertificateResource", MtlsCertificateArgs.builder()
        .accountId("string")
        .ca(false)
        .certificates("string")
        .name("string")
        .privateKey("string")
        .build());
    
    mtls_certificate_resource = cloudflare.MtlsCertificate("mtlsCertificateResource",
        account_id="string",
        ca=False,
        certificates="string",
        name="string",
        private_key="string")
    
    const mtlsCertificateResource = new cloudflare.MtlsCertificate("mtlsCertificateResource", {
        accountId: "string",
        ca: false,
        certificates: "string",
        name: "string",
        privateKey: "string",
    });
    
    type: cloudflare:MtlsCertificate
    properties:
        accountId: string
        ca: false
        certificates: string
        name: string
        privateKey: string
    

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

    AccountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    Ca bool
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    Certificates string
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    Name string
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    PrivateKey string
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    AccountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    Ca bool
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    Certificates string
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    Name string
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    PrivateKey string
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    ca Boolean
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    certificates String
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    name String
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    privateKey String
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    accountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    ca boolean
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    certificates string
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    name string
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    privateKey string
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    account_id str
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    ca bool
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    certificates str
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    name str
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    private_key str
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    ca Boolean
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    certificates String
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    name String
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    privateKey String
    The certificate's private key. Modifying this attribute will force creation of a new resource.

    Outputs

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

    ExpiresOn string
    Modifying this attribute will force creation of a new resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Issuer string
    Modifying this attribute will force creation of a new resource.
    SerialNumber string
    Modifying this attribute will force creation of a new resource.
    Signature string
    Modifying this attribute will force creation of a new resource.
    UploadedOn string
    Modifying this attribute will force creation of a new resource.
    ExpiresOn string
    Modifying this attribute will force creation of a new resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    Issuer string
    Modifying this attribute will force creation of a new resource.
    SerialNumber string
    Modifying this attribute will force creation of a new resource.
    Signature string
    Modifying this attribute will force creation of a new resource.
    UploadedOn string
    Modifying this attribute will force creation of a new resource.
    expiresOn String
    Modifying this attribute will force creation of a new resource.
    id String
    The provider-assigned unique ID for this managed resource.
    issuer String
    Modifying this attribute will force creation of a new resource.
    serialNumber String
    Modifying this attribute will force creation of a new resource.
    signature String
    Modifying this attribute will force creation of a new resource.
    uploadedOn String
    Modifying this attribute will force creation of a new resource.
    expiresOn string
    Modifying this attribute will force creation of a new resource.
    id string
    The provider-assigned unique ID for this managed resource.
    issuer string
    Modifying this attribute will force creation of a new resource.
    serialNumber string
    Modifying this attribute will force creation of a new resource.
    signature string
    Modifying this attribute will force creation of a new resource.
    uploadedOn string
    Modifying this attribute will force creation of a new resource.
    expires_on str
    Modifying this attribute will force creation of a new resource.
    id str
    The provider-assigned unique ID for this managed resource.
    issuer str
    Modifying this attribute will force creation of a new resource.
    serial_number str
    Modifying this attribute will force creation of a new resource.
    signature str
    Modifying this attribute will force creation of a new resource.
    uploaded_on str
    Modifying this attribute will force creation of a new resource.
    expiresOn String
    Modifying this attribute will force creation of a new resource.
    id String
    The provider-assigned unique ID for this managed resource.
    issuer String
    Modifying this attribute will force creation of a new resource.
    serialNumber String
    Modifying this attribute will force creation of a new resource.
    signature String
    Modifying this attribute will force creation of a new resource.
    uploadedOn String
    Modifying this attribute will force creation of a new resource.

    Look up Existing MtlsCertificate Resource

    Get an existing MtlsCertificate 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?: MtlsCertificateState, opts?: CustomResourceOptions): MtlsCertificate
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account_id: Optional[str] = None,
            ca: Optional[bool] = None,
            certificates: Optional[str] = None,
            expires_on: Optional[str] = None,
            issuer: Optional[str] = None,
            name: Optional[str] = None,
            private_key: Optional[str] = None,
            serial_number: Optional[str] = None,
            signature: Optional[str] = None,
            uploaded_on: Optional[str] = None) -> MtlsCertificate
    func GetMtlsCertificate(ctx *Context, name string, id IDInput, state *MtlsCertificateState, opts ...ResourceOption) (*MtlsCertificate, error)
    public static MtlsCertificate Get(string name, Input<string> id, MtlsCertificateState? state, CustomResourceOptions? opts = null)
    public static MtlsCertificate get(String name, Output<String> id, MtlsCertificateState 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:
    AccountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    Ca bool
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    Certificates string
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    ExpiresOn string
    Modifying this attribute will force creation of a new resource.
    Issuer string
    Modifying this attribute will force creation of a new resource.
    Name string
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    PrivateKey string
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    SerialNumber string
    Modifying this attribute will force creation of a new resource.
    Signature string
    Modifying this attribute will force creation of a new resource.
    UploadedOn string
    Modifying this attribute will force creation of a new resource.
    AccountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    Ca bool
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    Certificates string
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    ExpiresOn string
    Modifying this attribute will force creation of a new resource.
    Issuer string
    Modifying this attribute will force creation of a new resource.
    Name string
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    PrivateKey string
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    SerialNumber string
    Modifying this attribute will force creation of a new resource.
    Signature string
    Modifying this attribute will force creation of a new resource.
    UploadedOn string
    Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    ca Boolean
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    certificates String
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    expiresOn String
    Modifying this attribute will force creation of a new resource.
    issuer String
    Modifying this attribute will force creation of a new resource.
    name String
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    privateKey String
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    serialNumber String
    Modifying this attribute will force creation of a new resource.
    signature String
    Modifying this attribute will force creation of a new resource.
    uploadedOn String
    Modifying this attribute will force creation of a new resource.
    accountId string
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    ca boolean
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    certificates string
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    expiresOn string
    Modifying this attribute will force creation of a new resource.
    issuer string
    Modifying this attribute will force creation of a new resource.
    name string
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    privateKey string
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    serialNumber string
    Modifying this attribute will force creation of a new resource.
    signature string
    Modifying this attribute will force creation of a new resource.
    uploadedOn string
    Modifying this attribute will force creation of a new resource.
    account_id str
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    ca bool
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    certificates str
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    expires_on str
    Modifying this attribute will force creation of a new resource.
    issuer str
    Modifying this attribute will force creation of a new resource.
    name str
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    private_key str
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    serial_number str
    Modifying this attribute will force creation of a new resource.
    signature str
    Modifying this attribute will force creation of a new resource.
    uploaded_on str
    Modifying this attribute will force creation of a new resource.
    accountId String
    The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
    ca Boolean
    Whether this is a CA or leaf certificate. Modifying this attribute will force creation of a new resource.
    certificates String
    Certificate you intend to use with mTLS-enabled services. Modifying this attribute will force creation of a new resource.
    expiresOn String
    Modifying this attribute will force creation of a new resource.
    issuer String
    Modifying this attribute will force creation of a new resource.
    name String
    Optional unique name for the certificate. Modifying this attribute will force creation of a new resource.
    privateKey String
    The certificate's private key. Modifying this attribute will force creation of a new resource.
    serialNumber String
    Modifying this attribute will force creation of a new resource.
    signature String
    Modifying this attribute will force creation of a new resource.
    uploadedOn String
    Modifying this attribute will force creation of a new resource.

    Import

    $ pulumi import cloudflare:index/mtlsCertificate:MtlsCertificate example <account_id>/<mtls_certificate_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 v5.43.0 published on Wednesday, Nov 13, 2024 by Pulumi