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

com.pulumi.googlenative.networksecurity.v1.kotlin.ClientTlsPolicy.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.googlenative.networksecurity.v1.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.networksecurity.v1.kotlin.outputs.GoogleCloudNetworksecurityV1CertificateProviderResponse
import com.pulumi.googlenative.networksecurity.v1.kotlin.outputs.ValidationCAResponse
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.googlenative.networksecurity.v1.kotlin.outputs.GoogleCloudNetworksecurityV1CertificateProviderResponse.Companion.toKotlin as googleCloudNetworksecurityV1CertificateProviderResponseToKotlin
import com.pulumi.googlenative.networksecurity.v1.kotlin.outputs.ValidationCAResponse.Companion.toKotlin as validationCAResponseToKotlin

/**
 * Builder for [ClientTlsPolicy].
 */
@PulumiTagMarker
public class ClientTlsPolicyResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ClientTlsPolicyArgs = ClientTlsPolicyArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ClientTlsPolicyArgsBuilder.() -> Unit) {
        val builder = ClientTlsPolicyArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): ClientTlsPolicy {
        val builtJavaResource =
            com.pulumi.googlenative.networksecurity.v1.ClientTlsPolicy(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return ClientTlsPolicy(builtJavaResource)
    }
}

/**
 * Creates a new ClientTlsPolicy in a given project and location.
 */
public class ClientTlsPolicy internal constructor(
    override val javaResource: com.pulumi.googlenative.networksecurity.v1.ClientTlsPolicy,
) : KotlinCustomResource(javaResource, ClientTlsPolicyMapper) {
    /**
     * Optional. Defines a mechanism to provision client identity (public and private keys) for peer to peer authentication. The presence of this dictates mTLS.
     */
    public val clientCertificate: Output
        get() = javaResource.clientCertificate().applyValue({ args0 ->
            args0.let({ args0 ->
                googleCloudNetworksecurityV1CertificateProviderResponseToKotlin(args0)
            })
        })

    /**
     * Required. Short name of the ClientTlsPolicy resource to be created. This value should be 1-63 characters long, containing only letters, numbers, hyphens, and underscores, and should not start with a number. E.g. "client_mtls_policy".
     */
    public val clientTlsPolicyId: Output
        get() = javaResource.clientTlsPolicyId().applyValue({ args0 -> args0 })

    /**
     * The timestamp when the resource was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * Optional. Free-text description of the resource.
     */
    public val description: Output
        get() = javaResource.description().applyValue({ args0 -> args0 })

    /**
     * Optional. Set of label tags associated with the resource.
     */
    public val labels: Output>
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Name of the ClientTlsPolicy resource. It matches the pattern `projects/*/locations/{location}/clientTlsPolicies/{client_tls_policy}`
     * */
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * Optional. Defines the mechanism to obtain the Certificate Authority certificate to validate the server certificate. If empty, client does not validate the server certificate.
     */
    public val serverValidationCa: Output>
        get() = javaResource.serverValidationCa().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> validationCAResponseToKotlin(args0) })
            })
        })

    /**
     * Optional. Server Name Indication string to present to the server during TLS handshake. E.g: "secure.example.com".
     */
    public val sni: Output
        get() = javaResource.sni().applyValue({ args0 -> args0 })

    /**
     * The timestamp when the resource was updated.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object ClientTlsPolicyMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.networksecurity.v1.ClientTlsPolicy::class == javaResource::class

    override fun map(javaResource: Resource): ClientTlsPolicy = ClientTlsPolicy(
        javaResource as
            com.pulumi.googlenative.networksecurity.v1.ClientTlsPolicy,
    )
}

/**
 * @see [ClientTlsPolicy].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ClientTlsPolicy].
 */
public suspend fun clientTlsPolicy(
    name: String,
    block: suspend ClientTlsPolicyResourceBuilder.() -> Unit,
): ClientTlsPolicy {
    val builder = ClientTlsPolicyResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ClientTlsPolicy].
 * @param name The _unique_ name of the resulting resource.
 */
public fun clientTlsPolicy(name: String): ClientTlsPolicy {
    val builder = ClientTlsPolicyResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy