cloudflare.MtlsCertificate
Explore with Pulumi AI
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
The MtlsCertificate resource accepts the following input properties:
- Account
Id 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.
- Private
Key string - The certificate's private key. Modifying this attribute will force creation of a new resource.
- Account
Id 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.
- Private
Key string - The certificate's private key. Modifying this attribute will force creation of a new resource.
- account
Id 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.
- private
Key String - The certificate's private key. Modifying this attribute will force creation of a new resource.
- account
Id 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.
- private
Key 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.
- account
Id 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.
- private
Key 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:
- Expires
On 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.
- Serial
Number string - Modifying this attribute will force creation of a new resource.
- Signature string
- Modifying this attribute will force creation of a new resource.
- Uploaded
On string - Modifying this attribute will force creation of a new resource.
- Expires
On 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.
- Serial
Number string - Modifying this attribute will force creation of a new resource.
- Signature string
- Modifying this attribute will force creation of a new resource.
- Uploaded
On string - Modifying this attribute will force creation of a new resource.
- expires
On 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.
- serial
Number String - Modifying this attribute will force creation of a new resource.
- signature String
- Modifying this attribute will force creation of a new resource.
- uploaded
On String - Modifying this attribute will force creation of a new resource.
- expires
On 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.
- serial
Number string - Modifying this attribute will force creation of a new resource.
- signature string
- Modifying this attribute will force creation of a new resource.
- uploaded
On 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.
- expires
On 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.
- serial
Number String - Modifying this attribute will force creation of a new resource.
- signature String
- Modifying this attribute will force creation of a new resource.
- uploaded
On 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.
- Account
Id 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.
- Expires
On 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.
- Private
Key string - The certificate's private key. Modifying this attribute will force creation of a new resource.
- Serial
Number string - Modifying this attribute will force creation of a new resource.
- Signature string
- Modifying this attribute will force creation of a new resource.
- Uploaded
On string - Modifying this attribute will force creation of a new resource.
- Account
Id 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.
- Expires
On 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.
- Private
Key string - The certificate's private key. Modifying this attribute will force creation of a new resource.
- Serial
Number string - Modifying this attribute will force creation of a new resource.
- Signature string
- Modifying this attribute will force creation of a new resource.
- Uploaded
On string - Modifying this attribute will force creation of a new resource.
- account
Id 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.
- expires
On 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.
- private
Key String - The certificate's private key. Modifying this attribute will force creation of a new resource.
- serial
Number String - Modifying this attribute will force creation of a new resource.
- signature String
- Modifying this attribute will force creation of a new resource.
- uploaded
On String - Modifying this attribute will force creation of a new resource.
- account
Id 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.
- expires
On 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.
- private
Key string - The certificate's private key. Modifying this attribute will force creation of a new resource.
- serial
Number string - Modifying this attribute will force creation of a new resource.
- signature string
- Modifying this attribute will force creation of a new resource.
- uploaded
On 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.
- account
Id 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.
- expires
On 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.
- private
Key String - The certificate's private key. Modifying this attribute will force creation of a new resource.
- serial
Number String - Modifying this attribute will force creation of a new resource.
- signature String
- Modifying this attribute will force creation of a new resource.
- uploaded
On 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.