All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.cloudflare.kotlin.MtlsCertificateArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 5.47.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.MtlsCertificateArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Provides a Cloudflare mTLS certificate resource. These certificates may be used with mTLS enabled Cloudflare services.
 * ## Example Usage
 * 
 * ```typescript
 * 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,
 * });
 * ```
 * ```python
 * 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)
 * ```
 * ```csharp
 * 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,
 *     });
 * });
 * ```
 * ```go
 * 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
 * 	})
 * }
 * ```
 * ```java
 * 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());
 *     }
 * }
 * ```
 * ```yaml
 * 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
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/mtlsCertificate:MtlsCertificate example /
 * ```
 * @property accountId The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
 * @property ca Whether this is a CA or leaf certificate. **Modifying this attribute will force creation of a new resource.**
 * @property certificates Certificate you intend to use with mTLS-enabled services. **Modifying this attribute will force creation of a new resource.**
 * @property name Optional unique name for the certificate. **Modifying this attribute will force creation of a new resource.**
 * @property privateKey The certificate's private key. **Modifying this attribute will force creation of a new resource.**
 */
public data class MtlsCertificateArgs(
    public val accountId: Output? = null,
    public val ca: Output? = null,
    public val certificates: Output? = null,
    public val name: Output? = null,
    public val privateKey: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.MtlsCertificateArgs =
        com.pulumi.cloudflare.MtlsCertificateArgs.builder()
            .accountId(accountId?.applyValue({ args0 -> args0 }))
            .ca(ca?.applyValue({ args0 -> args0 }))
            .certificates(certificates?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .privateKey(privateKey?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [MtlsCertificateArgs].
 */
@PulumiTagMarker
public class MtlsCertificateArgsBuilder internal constructor() {
    private var accountId: Output? = null

    private var ca: Output? = null

    private var certificates: Output? = null

    private var name: Output? = null

    private var privateKey: Output? = null

    /**
     * @param value The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("tkasrylwvnvwcalu")
    public suspend fun accountId(`value`: Output) {
        this.accountId = value
    }

    /**
     * @param value Whether this is a CA or leaf certificate. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("elujvandokbqkunh")
    public suspend fun ca(`value`: Output) {
        this.ca = value
    }

    /**
     * @param value Certificate you intend to use with mTLS-enabled services. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("rxklftbkngbmoqls")
    public suspend fun certificates(`value`: Output) {
        this.certificates = value
    }

    /**
     * @param value Optional unique name for the certificate. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("vaultqtgskiuhece")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The certificate's private key. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("hoccalttxgatmylk")
    public suspend fun privateKey(`value`: Output) {
        this.privateKey = value
    }

    /**
     * @param value The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("hfuafkjtidavustq")
    public suspend fun accountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accountId = mapped
    }

    /**
     * @param value Whether this is a CA or leaf certificate. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("tlusbeximxiptgow")
    public suspend fun ca(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ca = mapped
    }

    /**
     * @param value Certificate you intend to use with mTLS-enabled services. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("cppaigqtuhrcdbga")
    public suspend fun certificates(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.certificates = mapped
    }

    /**
     * @param value Optional unique name for the certificate. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("dyqshwwfyjyfspxd")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The certificate's private key. **Modifying this attribute will force creation of a new resource.**
     */
    @JvmName("sgupjihwvywqikph")
    public suspend fun privateKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.privateKey = mapped
    }

    internal fun build(): MtlsCertificateArgs = MtlsCertificateArgs(
        accountId = accountId,
        ca = ca,
        certificates = certificates,
        name = name,
        privateKey = privateKey,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy