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

com.pulumi.cloudflare.kotlin.AccessMutualTlsCertificateArgs.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.AccessMutualTlsCertificateArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides a Cloudflare Access Mutual TLS Certificate resource.
 * Mutual TLS authentication ensures that the traffic is secure and
 * trusted in both directions between a client and server and can be
 *  used with Access to only allows requests from devices with a
 *  corresponding client certificate.
 * > It's required that an `account_id` or `zone_id` is provided and in
 *    most cases using either is fine. However, if you're using a scoped
 *    access token, you must provide the argument that matches the token's
 *    scope. For example, an access token that is scoped to the "example.com"
 *    zone needs to use the `zone_id` argument.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const myCert = new cloudflare.AccessMutualTlsCertificate("my_cert", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     name: "My Root Cert",
 *     certificate: caPem,
 *     associatedHostnames: ["staging.example.com"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * my_cert = cloudflare.AccessMutualTlsCertificate("my_cert",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     name="My Root Cert",
 *     certificate=ca_pem,
 *     associated_hostnames=["staging.example.com"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var myCert = new Cloudflare.AccessMutualTlsCertificate("my_cert", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         Name = "My Root Cert",
 *         Certificate = caPem,
 *         AssociatedHostnames = new[]
 *         {
 *             "staging.example.com",
 *         },
 *     });
 * });
 * ```
 * ```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.NewAccessMutualTlsCertificate(ctx, "my_cert", &cloudflare.AccessMutualTlsCertificateArgs{
 * 			ZoneId:      pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			Name:        pulumi.String("My Root Cert"),
 * 			Certificate: pulumi.Any(caPem),
 * 			AssociatedHostnames: pulumi.StringArray{
 * 				pulumi.String("staging.example.com"),
 * 			},
 * 		})
 * 		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.AccessMutualTlsCertificate;
 * import com.pulumi.cloudflare.AccessMutualTlsCertificateArgs;
 * 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 myCert = new AccessMutualTlsCertificate("myCert", AccessMutualTlsCertificateArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .name("My Root Cert")
 *             .certificate(caPem)
 *             .associatedHostnames("staging.example.com")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   myCert:
 *     type: cloudflare:AccessMutualTlsCertificate
 *     name: my_cert
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       name: My Root Cert
 *       certificate: ${caPem}
 *       associatedHostnames:
 *         - staging.example.com
 * ```
 * 
 * ## Import
 * Account level import.
 * ```sh
 * $ pulumi import cloudflare:index/accessMutualTlsCertificate:AccessMutualTlsCertificate example account//
 * ```
 * Zone level import.
 * ```sh
 * $ pulumi import cloudflare:index/accessMutualTlsCertificate:AccessMutualTlsCertificate example zone//
 * ```
 * @property accountId The account identifier to target for the resource. Conflicts with `zone_id`.
 * @property associatedHostnames The hostnames that will be prompted for this certificate.
 * @property certificate The Root CA for your certificates.
 * @property name The name of the certificate.
 * @property zoneId The zone identifier to target for the resource. Conflicts with `account_id`.
 */
public data class AccessMutualTlsCertificateArgs(
    public val accountId: Output? = null,
    public val associatedHostnames: Output>? = null,
    public val certificate: Output? = null,
    public val name: Output? = null,
    public val zoneId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.AccessMutualTlsCertificateArgs =
        com.pulumi.cloudflare.AccessMutualTlsCertificateArgs.builder()
            .accountId(accountId?.applyValue({ args0 -> args0 }))
            .associatedHostnames(associatedHostnames?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .certificate(certificate?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .zoneId(zoneId?.applyValue({ args0 -> args0 })).build()
}

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

    private var associatedHostnames: Output>? = null

    private var certificate: Output? = null

    private var name: Output? = null

    private var zoneId: Output? = null

    /**
     * @param value The account identifier to target for the resource. Conflicts with `zone_id`.
     */
    @JvmName("npkropmqnhnxmbgq")
    public suspend fun accountId(`value`: Output) {
        this.accountId = value
    }

    /**
     * @param value The hostnames that will be prompted for this certificate.
     */
    @JvmName("vkyxbxnysmfthkit")
    public suspend fun associatedHostnames(`value`: Output>) {
        this.associatedHostnames = value
    }

    @JvmName("ummbvqmvuqtghfii")
    public suspend fun associatedHostnames(vararg values: Output) {
        this.associatedHostnames = Output.all(values.asList())
    }

    /**
     * @param values The hostnames that will be prompted for this certificate.
     */
    @JvmName("hwbfcdwrwjwuwftc")
    public suspend fun associatedHostnames(values: List>) {
        this.associatedHostnames = Output.all(values)
    }

    /**
     * @param value The Root CA for your certificates.
     */
    @JvmName("qkynnxnjapnumyby")
    public suspend fun certificate(`value`: Output) {
        this.certificate = value
    }

    /**
     * @param value The name of the certificate.
     */
    @JvmName("eaxuusgqjgdwmdkl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The zone identifier to target for the resource. Conflicts with `account_id`.
     */
    @JvmName("bthrgkunlyjxylht")
    public suspend fun zoneId(`value`: Output) {
        this.zoneId = value
    }

    /**
     * @param value The account identifier to target for the resource. Conflicts with `zone_id`.
     */
    @JvmName("pxfhkvrrmnevksuy")
    public suspend fun accountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accountId = mapped
    }

    /**
     * @param value The hostnames that will be prompted for this certificate.
     */
    @JvmName("nktcoqlkybtxduem")
    public suspend fun associatedHostnames(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.associatedHostnames = mapped
    }

    /**
     * @param values The hostnames that will be prompted for this certificate.
     */
    @JvmName("pobswikhupndgeru")
    public suspend fun associatedHostnames(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.associatedHostnames = mapped
    }

    /**
     * @param value The Root CA for your certificates.
     */
    @JvmName("mtyovamrdbceavqu")
    public suspend fun certificate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.certificate = mapped
    }

    /**
     * @param value The name of the certificate.
     */
    @JvmName("kkpocryfaymnqjae")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The zone identifier to target for the resource. Conflicts with `account_id`.
     */
    @JvmName("ndbpunomhcvfhwem")
    public suspend fun zoneId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zoneId = mapped
    }

    internal fun build(): AccessMutualTlsCertificateArgs = AccessMutualTlsCertificateArgs(
        accountId = accountId,
        associatedHostnames = associatedHostnames,
        certificate = certificate,
        name = name,
        zoneId = zoneId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy