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

com.pulumi.gcp.certificatemanager.kotlin.TrustConfigArgs.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: 8.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.certificatemanager.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.certificatemanager.TrustConfigArgs.builder
import com.pulumi.gcp.certificatemanager.kotlin.inputs.TrustConfigTrustStoreArgs
import com.pulumi.gcp.certificatemanager.kotlin.inputs.TrustConfigTrustStoreArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * TrustConfig represents a resource that represents your Public Key Infrastructure (PKI) configuration in Certificate Manager for use in mutual TLS authentication scenarios.
 * To get more information about TrustConfig, see:
 * * [API documentation](https://cloud.google.com/certificate-manager/docs/reference/certificate-manager/rest/v1/projects.locations.trustConfigs/create)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/certificate-manager/docs)
 * ## Example Usage
 * ### Certificate Manager Trust Config
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 * const _default = new gcp.certificatemanager.TrustConfig("default", {
 *     name: "trust-config",
 *     description: "sample description for the trust config",
 *     location: "us-central1",
 *     trustStores: [{
 *         trustAnchors: [{
 *             pemCertificate: std.file({
 *                 input: "test-fixtures/cert.pem",
 *             }).then(invoke => invoke.result),
 *         }],
 *         intermediateCas: [{
 *             pemCertificate: std.file({
 *                 input: "test-fixtures/cert.pem",
 *             }).then(invoke => invoke.result),
 *         }],
 *     }],
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * import pulumi_std as std
 * default = gcp.certificatemanager.TrustConfig("default",
 *     name="trust-config",
 *     description="sample description for the trust config",
 *     location="us-central1",
 *     trust_stores=[gcp.certificatemanager.TrustConfigTrustStoreArgs(
 *         trust_anchors=[gcp.certificatemanager.TrustConfigTrustStoreTrustAnchorArgs(
 *             pem_certificate=std.file(input="test-fixtures/cert.pem").result,
 *         )],
 *         intermediate_cas=[gcp.certificatemanager.TrustConfigTrustStoreIntermediateCaArgs(
 *             pem_certificate=std.file(input="test-fixtures/cert.pem").result,
 *         )],
 *     )],
 *     labels={
 *         "foo": "bar",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.CertificateManager.TrustConfig("default", new()
 *     {
 *         Name = "trust-config",
 *         Description = "sample description for the trust config",
 *         Location = "us-central1",
 *         TrustStores = new[]
 *         {
 *             new Gcp.CertificateManager.Inputs.TrustConfigTrustStoreArgs
 *             {
 *                 TrustAnchors = new[]
 *                 {
 *                     new Gcp.CertificateManager.Inputs.TrustConfigTrustStoreTrustAnchorArgs
 *                     {
 *                         PemCertificate = Std.File.Invoke(new()
 *                         {
 *                             Input = "test-fixtures/cert.pem",
 *                         }).Apply(invoke => invoke.Result),
 *                     },
 *                 },
 *                 IntermediateCas = new[]
 *                 {
 *                     new Gcp.CertificateManager.Inputs.TrustConfigTrustStoreIntermediateCaArgs
 *                     {
 *                         PemCertificate = Std.File.Invoke(new()
 *                         {
 *                             Input = "test-fixtures/cert.pem",
 *                         }).Apply(invoke => invoke.Result),
 *                     },
 *                 },
 *             },
 *         },
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/certificatemanager"
 * 	"github.com/pulumi/pulumi-std/sdk/go/std"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		invokeFile, err := std.File(ctx, &std.FileArgs{
 * 			Input: "test-fixtures/cert.pem",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile1, err := std.File(ctx, &std.FileArgs{
 * 			Input: "test-fixtures/cert.pem",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = certificatemanager.NewTrustConfig(ctx, "default", &certificatemanager.TrustConfigArgs{
 * 			Name:        pulumi.String("trust-config"),
 * 			Description: pulumi.String("sample description for the trust config"),
 * 			Location:    pulumi.String("us-central1"),
 * 			TrustStores: certificatemanager.TrustConfigTrustStoreArray{
 * 				&certificatemanager.TrustConfigTrustStoreArgs{
 * 					TrustAnchors: certificatemanager.TrustConfigTrustStoreTrustAnchorArray{
 * 						&certificatemanager.TrustConfigTrustStoreTrustAnchorArgs{
 * 							PemCertificate: invokeFile.Result,
 * 						},
 * 					},
 * 					IntermediateCas: certificatemanager.TrustConfigTrustStoreIntermediateCaArray{
 * 						&certificatemanager.TrustConfigTrustStoreIntermediateCaArgs{
 * 							PemCertificate: invokeFile1.Result,
 * 						},
 * 					},
 * 				},
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 		})
 * 		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.certificatemanager.TrustConfig;
 * import com.pulumi.gcp.certificatemanager.TrustConfigArgs;
 * import com.pulumi.gcp.certificatemanager.inputs.TrustConfigTrustStoreArgs;
 * 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 TrustConfig("default", TrustConfigArgs.builder()
 *             .name("trust-config")
 *             .description("sample description for the trust config")
 *             .location("us-central1")
 *             .trustStores(TrustConfigTrustStoreArgs.builder()
 *                 .trustAnchors(TrustConfigTrustStoreTrustAnchorArgs.builder()
 *                     .pemCertificate(StdFunctions.file(FileArgs.builder()
 *                         .input("test-fixtures/cert.pem")
 *                         .build()).result())
 *                     .build())
 *                 .intermediateCas(TrustConfigTrustStoreIntermediateCaArgs.builder()
 *                     .pemCertificate(StdFunctions.file(FileArgs.builder()
 *                         .input("test-fixtures/cert.pem")
 *                         .build()).result())
 *                     .build())
 *                 .build())
 *             .labels(Map.of("foo", "bar"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:certificatemanager:TrustConfig
 *     properties:
 *       name: trust-config
 *       description: sample description for the trust config
 *       location: us-central1
 *       trustStores:
 *         - trustAnchors:
 *             - pemCertificate:
 *                 fn::invoke:
 *                   Function: std:file
 *                   Arguments:
 *                     input: test-fixtures/cert.pem
 *                   Return: result
 *           intermediateCas:
 *             - pemCertificate:
 *                 fn::invoke:
 *                   Function: std:file
 *                   Arguments:
 *                     input: test-fixtures/cert.pem
 *                   Return: result
 *       labels:
 *         foo: bar
 * ```
 * 
 * ## Import
 * TrustConfig can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/trustConfigs/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, TrustConfig can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:certificatemanager/trustConfig:TrustConfig default projects/{{project}}/locations/{{location}}/trustConfigs/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:certificatemanager/trustConfig:TrustConfig default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:certificatemanager/trustConfig:TrustConfig default {{location}}/{{name}}
 * ```
 * @property description One or more paragraphs of text description of a trust config.
 * @property labels Set of label tags associated with the trust config.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property location The trust config location.
 * - - -
 * @property name A user-defined name of the trust config. Trust config names must be unique globally.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property trustStores Set of trust stores to perform validation against.
 * This field is supported when TrustConfig is configured with Load Balancers, currently not supported for SPIFFE certificate validation.
 * Structure is documented below.
 */
public data class TrustConfigArgs(
    public val description: Output? = null,
    public val labels: Output>? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val trustStores: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.certificatemanager.TrustConfigArgs =
        com.pulumi.gcp.certificatemanager.TrustConfigArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .trustStores(
                trustStores?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [TrustConfigArgs].
 */
@PulumiTagMarker
public class TrustConfigArgsBuilder internal constructor() {
    private var description: Output? = null

    private var labels: Output>? = null

    private var location: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var trustStores: Output>? = null

    /**
     * @param value One or more paragraphs of text description of a trust config.
     */
    @JvmName("spswtnjyqixysaex")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Set of label tags associated with the trust config.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("axiaoctewssllasj")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The trust config location.
     * - - -
     */
    @JvmName("jojlarrdnrmnocod")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value A user-defined name of the trust config. Trust config names must be unique globally.
     */
    @JvmName("pjwikxtqdphxcsrd")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("wbfcjfwjowgwnjjm")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Set of trust stores to perform validation against.
     * This field is supported when TrustConfig is configured with Load Balancers, currently not supported for SPIFFE certificate validation.
     * Structure is documented below.
     */
    @JvmName("kubormpdniwcakew")
    public suspend fun trustStores(`value`: Output>) {
        this.trustStores = value
    }

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

    /**
     * @param values Set of trust stores to perform validation against.
     * This field is supported when TrustConfig is configured with Load Balancers, currently not supported for SPIFFE certificate validation.
     * Structure is documented below.
     */
    @JvmName("oklkadjasstlhphd")
    public suspend fun trustStores(values: List>) {
        this.trustStores = Output.all(values)
    }

    /**
     * @param value One or more paragraphs of text description of a trust config.
     */
    @JvmName("hfwwinovxehmjbcg")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Set of label tags associated with the trust config.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("lpescxrdobhqnrjk")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Set of label tags associated with the trust config.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("sykdqotrdkkawlnw")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The trust config location.
     * - - -
     */
    @JvmName("lgrnsoecqayatfsy")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value A user-defined name of the trust config. Trust config names must be unique globally.
     */
    @JvmName("ippupvgrvgmyjfph")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("lybvrghidosjcgio")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value Set of trust stores to perform validation against.
     * This field is supported when TrustConfig is configured with Load Balancers, currently not supported for SPIFFE certificate validation.
     * Structure is documented below.
     */
    @JvmName("qbeegrrumnawdlli")
    public suspend fun trustStores(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.trustStores = mapped
    }

    /**
     * @param argument Set of trust stores to perform validation against.
     * This field is supported when TrustConfig is configured with Load Balancers, currently not supported for SPIFFE certificate validation.
     * Structure is documented below.
     */
    @JvmName("sscociueomcsqsmi")
    public suspend fun trustStores(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TrustConfigTrustStoreArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.trustStores = mapped
    }

    /**
     * @param argument Set of trust stores to perform validation against.
     * This field is supported when TrustConfig is configured with Load Balancers, currently not supported for SPIFFE certificate validation.
     * Structure is documented below.
     */
    @JvmName("jhfpqcyljcdyjebe")
    public suspend fun trustStores(vararg argument: suspend TrustConfigTrustStoreArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            TrustConfigTrustStoreArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.trustStores = mapped
    }

    /**
     * @param argument Set of trust stores to perform validation against.
     * This field is supported when TrustConfig is configured with Load Balancers, currently not supported for SPIFFE certificate validation.
     * Structure is documented below.
     */
    @JvmName("mqobwecuphohwias")
    public suspend fun trustStores(argument: suspend TrustConfigTrustStoreArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TrustConfigTrustStoreArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.trustStores = mapped
    }

    /**
     * @param values Set of trust stores to perform validation against.
     * This field is supported when TrustConfig is configured with Load Balancers, currently not supported for SPIFFE certificate validation.
     * Structure is documented below.
     */
    @JvmName("sgjiihyivfducwhj")
    public suspend fun trustStores(vararg values: TrustConfigTrustStoreArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.trustStores = mapped
    }

    internal fun build(): TrustConfigArgs = TrustConfigArgs(
        description = description,
        labels = labels,
        location = location,
        name = name,
        project = project,
        trustStores = trustStores,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy