com.pulumi.gcp.networksecurity.kotlin.ClientTlsPolicy.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.networksecurity.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.networksecurity.kotlin.outputs.ClientTlsPolicyClientCertificate
import com.pulumi.gcp.networksecurity.kotlin.outputs.ClientTlsPolicyServerValidationCa
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.gcp.networksecurity.kotlin.outputs.ClientTlsPolicyClientCertificate.Companion.toKotlin as clientTlsPolicyClientCertificateToKotlin
import com.pulumi.gcp.networksecurity.kotlin.outputs.ClientTlsPolicyServerValidationCa.Companion.toKotlin as clientTlsPolicyServerValidationCaToKotlin
/**
* 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.gcp.networksecurity.ClientTlsPolicy(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ClientTlsPolicy(builtJavaResource)
}
}
/**
* ## Example Usage
* ### Network Security Client Tls Policy Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.networksecurity.ClientTlsPolicy("default", {
* name: "my-client-tls-policy",
* labels: {
* foo: "bar",
* },
* description: "my description",
* sni: "secure.example.com",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.networksecurity.ClientTlsPolicy("default",
* name="my-client-tls-policy",
* labels={
* "foo": "bar",
* },
* description="my description",
* sni="secure.example.com")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.NetworkSecurity.ClientTlsPolicy("default", new()
* {
* Name = "my-client-tls-policy",
* Labels =
* {
* { "foo", "bar" },
* },
* Description = "my description",
* Sni = "secure.example.com",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networksecurity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := networksecurity.NewClientTlsPolicy(ctx, "default", &networksecurity.ClientTlsPolicyArgs{
* Name: pulumi.String("my-client-tls-policy"),
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* Description: pulumi.String("my description"),
* Sni: pulumi.String("secure.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.gcp.networksecurity.ClientTlsPolicy;
* import com.pulumi.gcp.networksecurity.ClientTlsPolicyArgs;
* 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 default_ = new ClientTlsPolicy("default", ClientTlsPolicyArgs.builder()
* .name("my-client-tls-policy")
* .labels(Map.of("foo", "bar"))
* .description("my description")
* .sni("secure.example.com")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:networksecurity:ClientTlsPolicy
* properties:
* name: my-client-tls-policy
* labels:
* foo: bar
* description: my description
* sni: secure.example.com
* ```
*
* ### Network Security Client Tls Policy Advanced
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.networksecurity.ClientTlsPolicy("default", {
* name: "my-client-tls-policy",
* labels: {
* foo: "bar",
* },
* description: "my description",
* clientCertificate: {
* certificateProviderInstance: {
* pluginInstance: "google_cloud_private_spiffe",
* },
* },
* serverValidationCas: [
* {
* grpcEndpoint: {
* targetUri: "unix:mypath",
* },
* },
* {
* grpcEndpoint: {
* targetUri: "unix:mypath1",
* },
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.networksecurity.ClientTlsPolicy("default",
* name="my-client-tls-policy",
* labels={
* "foo": "bar",
* },
* description="my description",
* client_certificate=gcp.networksecurity.ClientTlsPolicyClientCertificateArgs(
* certificate_provider_instance=gcp.networksecurity.ClientTlsPolicyClientCertificateCertificateProviderInstanceArgs(
* plugin_instance="google_cloud_private_spiffe",
* ),
* ),
* server_validation_cas=[
* gcp.networksecurity.ClientTlsPolicyServerValidationCaArgs(
* grpc_endpoint=gcp.networksecurity.ClientTlsPolicyServerValidationCaGrpcEndpointArgs(
* target_uri="unix:mypath",
* ),
* ),
* gcp.networksecurity.ClientTlsPolicyServerValidationCaArgs(
* grpc_endpoint=gcp.networksecurity.ClientTlsPolicyServerValidationCaGrpcEndpointArgs(
* target_uri="unix:mypath1",
* ),
* ),
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.NetworkSecurity.ClientTlsPolicy("default", new()
* {
* Name = "my-client-tls-policy",
* Labels =
* {
* { "foo", "bar" },
* },
* Description = "my description",
* ClientCertificate = new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyClientCertificateArgs
* {
* CertificateProviderInstance = new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyClientCertificateCertificateProviderInstanceArgs
* {
* PluginInstance = "google_cloud_private_spiffe",
* },
* },
* ServerValidationCas = new[]
* {
* new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyServerValidationCaArgs
* {
* GrpcEndpoint = new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyServerValidationCaGrpcEndpointArgs
* {
* TargetUri = "unix:mypath",
* },
* },
* new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyServerValidationCaArgs
* {
* GrpcEndpoint = new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyServerValidationCaGrpcEndpointArgs
* {
* TargetUri = "unix:mypath1",
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networksecurity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := networksecurity.NewClientTlsPolicy(ctx, "default", &networksecurity.ClientTlsPolicyArgs{
* Name: pulumi.String("my-client-tls-policy"),
* Labels: pulumi.StringMap{
* "foo": pulumi.String("bar"),
* },
* Description: pulumi.String("my description"),
* ClientCertificate: &networksecurity.ClientTlsPolicyClientCertificateArgs{
* CertificateProviderInstance: &networksecurity.ClientTlsPolicyClientCertificateCertificateProviderInstanceArgs{
* PluginInstance: pulumi.String("google_cloud_private_spiffe"),
* },
* },
* ServerValidationCas: networksecurity.ClientTlsPolicyServerValidationCaArray{
* &networksecurity.ClientTlsPolicyServerValidationCaArgs{
* GrpcEndpoint: &networksecurity.ClientTlsPolicyServerValidationCaGrpcEndpointArgs{
* TargetUri: pulumi.String("unix:mypath"),
* },
* },
* &networksecurity.ClientTlsPolicyServerValidationCaArgs{
* GrpcEndpoint: &networksecurity.ClientTlsPolicyServerValidationCaGrpcEndpointArgs{
* TargetUri: pulumi.String("unix:mypath1"),
* },
* },
* },
* })
* 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.gcp.networksecurity.ClientTlsPolicy;
* import com.pulumi.gcp.networksecurity.ClientTlsPolicyArgs;
* import com.pulumi.gcp.networksecurity.inputs.ClientTlsPolicyClientCertificateArgs;
* import com.pulumi.gcp.networksecurity.inputs.ClientTlsPolicyClientCertificateCertificateProviderInstanceArgs;
* import com.pulumi.gcp.networksecurity.inputs.ClientTlsPolicyServerValidationCaArgs;
* import com.pulumi.gcp.networksecurity.inputs.ClientTlsPolicyServerValidationCaGrpcEndpointArgs;
* 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 default_ = new ClientTlsPolicy("default", ClientTlsPolicyArgs.builder()
* .name("my-client-tls-policy")
* .labels(Map.of("foo", "bar"))
* .description("my description")
* .clientCertificate(ClientTlsPolicyClientCertificateArgs.builder()
* .certificateProviderInstance(ClientTlsPolicyClientCertificateCertificateProviderInstanceArgs.builder()
* .pluginInstance("google_cloud_private_spiffe")
* .build())
* .build())
* .serverValidationCas(
* ClientTlsPolicyServerValidationCaArgs.builder()
* .grpcEndpoint(ClientTlsPolicyServerValidationCaGrpcEndpointArgs.builder()
* .targetUri("unix:mypath")
* .build())
* .build(),
* ClientTlsPolicyServerValidationCaArgs.builder()
* .grpcEndpoint(ClientTlsPolicyServerValidationCaGrpcEndpointArgs.builder()
* .targetUri("unix:mypath1")
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:networksecurity:ClientTlsPolicy
* properties:
* name: my-client-tls-policy
* labels:
* foo: bar
* description: my description
* clientCertificate:
* certificateProviderInstance:
* pluginInstance: google_cloud_private_spiffe
* serverValidationCas:
* - grpcEndpoint:
* targetUri: unix:mypath
* - grpcEndpoint:
* targetUri: unix:mypath1
* ```
*
* ## Import
* ClientTlsPolicy can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/{{location}}/clientTlsPolicies/{{name}}`
* * `{{project}}/{{location}}/{{name}}`
* * `{{location}}/{{name}}`
* When using the `pulumi import` command, ClientTlsPolicy can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:networksecurity/clientTlsPolicy:ClientTlsPolicy default projects/{{project}}/locations/{{location}}/clientTlsPolicies/{{name}}
* ```
* ```sh
* $ pulumi import gcp:networksecurity/clientTlsPolicy:ClientTlsPolicy default {{project}}/{{location}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:networksecurity/clientTlsPolicy:ClientTlsPolicy default {{location}}/{{name}}
* ```
*/
public class ClientTlsPolicy internal constructor(
override val javaResource: com.pulumi.gcp.networksecurity.ClientTlsPolicy,
) : KotlinCustomResource(javaResource, ClientTlsPolicyMapper) {
/**
* Defines a mechanism to provision client identity (public and private keys) for peer to peer authentication. The presence of this dictates mTLS.
* Structure is documented below.
*/
public val clientCertificate: Output?
get() = javaResource.clientCertificate().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> clientTlsPolicyClientCertificateToKotlin(args0) })
}).orElse(null)
})
/**
* Time the ClientTlsPolicy was created in UTC.
*/
public val createTime: Output
get() = javaResource.createTime().applyValue({ args0 -> args0 })
/**
* A free-text description of the resource. Max length 1024 characters.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
public val effectiveLabels: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy