com.pulumi.cloudflare.kotlin.ZeroTrustAccessMtlsCertificateArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-cloudflare-kotlin Show documentation
Show all versions of pulumi-cloudflare-kotlin Show documentation
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.ZeroTrustAccessMtlsCertificateArgs.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.ZeroTrustAccessMtlsCertificate("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.ZeroTrustAccessMtlsCertificate("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.ZeroTrustAccessMtlsCertificate("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.NewZeroTrustAccessMtlsCertificate(ctx, "my_cert", &cloudflare.ZeroTrustAccessMtlsCertificateArgs{
* 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.ZeroTrustAccessMtlsCertificate;
* import com.pulumi.cloudflare.ZeroTrustAccessMtlsCertificateArgs;
* 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 ZeroTrustAccessMtlsCertificate("myCert", ZeroTrustAccessMtlsCertificateArgs.builder()
* .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
* .name("My Root Cert")
* .certificate(caPem)
* .associatedHostnames("staging.example.com")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* myCert:
* type: cloudflare:ZeroTrustAccessMtlsCertificate
* 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/zeroTrustAccessMtlsCertificate:ZeroTrustAccessMtlsCertificate cloudflare_zero_sd -t_access_mtls_certificate.example account//
* ```
* Zone level import.
* ```sh
* $ pulumi import cloudflare:index/zeroTrustAccessMtlsCertificate:ZeroTrustAccessMtlsCertificate cloudflare_zero_sd -t_access_mtls_certificate.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 ZeroTrustAccessMtlsCertificateArgs(
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.ZeroTrustAccessMtlsCertificateArgs =
com.pulumi.cloudflare.ZeroTrustAccessMtlsCertificateArgs.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 [ZeroTrustAccessMtlsCertificateArgs].
*/
@PulumiTagMarker
public class ZeroTrustAccessMtlsCertificateArgsBuilder 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("csifgjhibeybffil")
public suspend fun accountId(`value`: Output) {
this.accountId = value
}
/**
* @param value The hostnames that will be prompted for this certificate.
*/
@JvmName("fljkkehjpnovymhm")
public suspend fun associatedHostnames(`value`: Output>) {
this.associatedHostnames = value
}
@JvmName("sxkerxupthfomxve")
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("sfsjsurbpysyvfeu")
public suspend fun associatedHostnames(values: List