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

com.pulumi.gcp.certificatemanager.kotlin.CertificateMapEntry.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.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

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

    public var args: CertificateMapEntryArgs = CertificateMapEntryArgs()

    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 CertificateMapEntryArgsBuilder.() -> Unit) {
        val builder = CertificateMapEntryArgsBuilder()
        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(): CertificateMapEntry {
        val builtJavaResource =
            com.pulumi.gcp.certificatemanager.CertificateMapEntry(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return CertificateMapEntry(builtJavaResource)
    }
}

/**
 * CertificateMapEntry is a list of certificate configurations,
 * that have been issued for a particular hostname
 * ## Example Usage
 * ### Certificate Manager Certificate Map Entry Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const certificateMap = new gcp.certificatemanager.CertificateMap("certificate_map", {
 *     name: "cert-map-entry",
 *     description: "My acceptance test certificate map",
 *     labels: {
 *         terraform: "true",
 *         "acc-test": "true",
 *     },
 * });
 * const instance = new gcp.certificatemanager.DnsAuthorization("instance", {
 *     name: "dns-auth",
 *     description: "The default dnss",
 *     domain: "subdomain.hashicorptest.com",
 * });
 * const instance2 = new gcp.certificatemanager.DnsAuthorization("instance2", {
 *     name: "dns-auth2",
 *     description: "The default dnss",
 *     domain: "subdomain2.hashicorptest.com",
 * });
 * const certificate = new gcp.certificatemanager.Certificate("certificate", {
 *     name: "cert-map-entry",
 *     description: "The default cert",
 *     scope: "DEFAULT",
 *     managed: {
 *         domains: [
 *             instance.domain,
 *             instance2.domain,
 *         ],
 *         dnsAuthorizations: [
 *             instance.id,
 *             instance2.id,
 *         ],
 *     },
 * });
 * const _default = new gcp.certificatemanager.CertificateMapEntry("default", {
 *     name: "cert-map-entry",
 *     description: "My acceptance test certificate map entry",
 *     map: certificateMap.name,
 *     labels: {
 *         terraform: "true",
 *         "acc-test": "true",
 *     },
 *     certificates: [certificate.id],
 *     matcher: "PRIMARY",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * certificate_map = gcp.certificatemanager.CertificateMap("certificate_map",
 *     name="cert-map-entry",
 *     description="My acceptance test certificate map",
 *     labels={
 *         "terraform": "true",
 *         "acc-test": "true",
 *     })
 * instance = gcp.certificatemanager.DnsAuthorization("instance",
 *     name="dns-auth",
 *     description="The default dnss",
 *     domain="subdomain.hashicorptest.com")
 * instance2 = gcp.certificatemanager.DnsAuthorization("instance2",
 *     name="dns-auth2",
 *     description="The default dnss",
 *     domain="subdomain2.hashicorptest.com")
 * certificate = gcp.certificatemanager.Certificate("certificate",
 *     name="cert-map-entry",
 *     description="The default cert",
 *     scope="DEFAULT",
 *     managed=gcp.certificatemanager.CertificateManagedArgs(
 *         domains=[
 *             instance.domain,
 *             instance2.domain,
 *         ],
 *         dns_authorizations=[
 *             instance.id,
 *             instance2.id,
 *         ],
 *     ))
 * default = gcp.certificatemanager.CertificateMapEntry("default",
 *     name="cert-map-entry",
 *     description="My acceptance test certificate map entry",
 *     map=certificate_map.name,
 *     labels={
 *         "terraform": "true",
 *         "acc-test": "true",
 *     },
 *     certificates=[certificate.id],
 *     matcher="PRIMARY")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var certificateMap = new Gcp.CertificateManager.CertificateMap("certificate_map", new()
 *     {
 *         Name = "cert-map-entry",
 *         Description = "My acceptance test certificate map",
 *         Labels =
 *         {
 *             { "terraform", "true" },
 *             { "acc-test", "true" },
 *         },
 *     });
 *     var instance = new Gcp.CertificateManager.DnsAuthorization("instance", new()
 *     {
 *         Name = "dns-auth",
 *         Description = "The default dnss",
 *         Domain = "subdomain.hashicorptest.com",
 *     });
 *     var instance2 = new Gcp.CertificateManager.DnsAuthorization("instance2", new()
 *     {
 *         Name = "dns-auth2",
 *         Description = "The default dnss",
 *         Domain = "subdomain2.hashicorptest.com",
 *     });
 *     var certificate = new Gcp.CertificateManager.Certificate("certificate", new()
 *     {
 *         Name = "cert-map-entry",
 *         Description = "The default cert",
 *         Scope = "DEFAULT",
 *         Managed = new Gcp.CertificateManager.Inputs.CertificateManagedArgs
 *         {
 *             Domains = new[]
 *             {
 *                 instance.Domain,
 *                 instance2.Domain,
 *             },
 *             DnsAuthorizations = new[]
 *             {
 *                 instance.Id,
 *                 instance2.Id,
 *             },
 *         },
 *     });
 *     var @default = new Gcp.CertificateManager.CertificateMapEntry("default", new()
 *     {
 *         Name = "cert-map-entry",
 *         Description = "My acceptance test certificate map entry",
 *         Map = certificateMap.Name,
 *         Labels =
 *         {
 *             { "terraform", "true" },
 *             { "acc-test", "true" },
 *         },
 *         Certificates = new[]
 *         {
 *             certificate.Id,
 *         },
 *         Matcher = "PRIMARY",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/certificatemanager"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		certificateMap, err := certificatemanager.NewCertificateMap(ctx, "certificate_map", &certificatemanager.CertificateMapArgs{
 * 			Name:        pulumi.String("cert-map-entry"),
 * 			Description: pulumi.String("My acceptance test certificate map"),
 * 			Labels: pulumi.StringMap{
 * 				"terraform": pulumi.String("true"),
 * 				"acc-test":  pulumi.String("true"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		instance, err := certificatemanager.NewDnsAuthorization(ctx, "instance", &certificatemanager.DnsAuthorizationArgs{
 * 			Name:        pulumi.String("dns-auth"),
 * 			Description: pulumi.String("The default dnss"),
 * 			Domain:      pulumi.String("subdomain.hashicorptest.com"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		instance2, err := certificatemanager.NewDnsAuthorization(ctx, "instance2", &certificatemanager.DnsAuthorizationArgs{
 * 			Name:        pulumi.String("dns-auth2"),
 * 			Description: pulumi.String("The default dnss"),
 * 			Domain:      pulumi.String("subdomain2.hashicorptest.com"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		certificate, err := certificatemanager.NewCertificate(ctx, "certificate", &certificatemanager.CertificateArgs{
 * 			Name:        pulumi.String("cert-map-entry"),
 * 			Description: pulumi.String("The default cert"),
 * 			Scope:       pulumi.String("DEFAULT"),
 * 			Managed: &certificatemanager.CertificateManagedArgs{
 * 				Domains: pulumi.StringArray{
 * 					instance.Domain,
 * 					instance2.Domain,
 * 				},
 * 				DnsAuthorizations: pulumi.StringArray{
 * 					instance.ID(),
 * 					instance2.ID(),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = certificatemanager.NewCertificateMapEntry(ctx, "default", &certificatemanager.CertificateMapEntryArgs{
 * 			Name:        pulumi.String("cert-map-entry"),
 * 			Description: pulumi.String("My acceptance test certificate map entry"),
 * 			Map:         certificateMap.Name,
 * 			Labels: pulumi.StringMap{
 * 				"terraform": pulumi.String("true"),
 * 				"acc-test":  pulumi.String("true"),
 * 			},
 * 			Certificates: pulumi.StringArray{
 * 				certificate.ID(),
 * 			},
 * 			Matcher: pulumi.String("PRIMARY"),
 * 		})
 * 		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.CertificateMap;
 * import com.pulumi.gcp.certificatemanager.CertificateMapArgs;
 * import com.pulumi.gcp.certificatemanager.DnsAuthorization;
 * import com.pulumi.gcp.certificatemanager.DnsAuthorizationArgs;
 * import com.pulumi.gcp.certificatemanager.Certificate;
 * import com.pulumi.gcp.certificatemanager.CertificateArgs;
 * import com.pulumi.gcp.certificatemanager.inputs.CertificateManagedArgs;
 * import com.pulumi.gcp.certificatemanager.CertificateMapEntry;
 * import com.pulumi.gcp.certificatemanager.CertificateMapEntryArgs;
 * 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 certificateMap = new CertificateMap("certificateMap", CertificateMapArgs.builder()
 *             .name("cert-map-entry")
 *             .description("My acceptance test certificate map")
 *             .labels(Map.ofEntries(
 *                 Map.entry("terraform", true),
 *                 Map.entry("acc-test", true)
 *             ))
 *             .build());
 *         var instance = new DnsAuthorization("instance", DnsAuthorizationArgs.builder()
 *             .name("dns-auth")
 *             .description("The default dnss")
 *             .domain("subdomain.hashicorptest.com")
 *             .build());
 *         var instance2 = new DnsAuthorization("instance2", DnsAuthorizationArgs.builder()
 *             .name("dns-auth2")
 *             .description("The default dnss")
 *             .domain("subdomain2.hashicorptest.com")
 *             .build());
 *         var certificate = new Certificate("certificate", CertificateArgs.builder()
 *             .name("cert-map-entry")
 *             .description("The default cert")
 *             .scope("DEFAULT")
 *             .managed(CertificateManagedArgs.builder()
 *                 .domains(
 *                     instance.domain(),
 *                     instance2.domain())
 *                 .dnsAuthorizations(
 *                     instance.id(),
 *                     instance2.id())
 *                 .build())
 *             .build());
 *         var default_ = new CertificateMapEntry("default", CertificateMapEntryArgs.builder()
 *             .name("cert-map-entry")
 *             .description("My acceptance test certificate map entry")
 *             .map(certificateMap.name())
 *             .labels(Map.ofEntries(
 *                 Map.entry("terraform", true),
 *                 Map.entry("acc-test", true)
 *             ))
 *             .certificates(certificate.id())
 *             .matcher("PRIMARY")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   certificateMap:
 *     type: gcp:certificatemanager:CertificateMap
 *     name: certificate_map
 *     properties:
 *       name: cert-map-entry
 *       description: My acceptance test certificate map
 *       labels:
 *         terraform: true
 *         acc-test: true
 *   default:
 *     type: gcp:certificatemanager:CertificateMapEntry
 *     properties:
 *       name: cert-map-entry
 *       description: My acceptance test certificate map entry
 *       map: ${certificateMap.name}
 *       labels:
 *         terraform: true
 *         acc-test: true
 *       certificates:
 *         - ${certificate.id}
 *       matcher: PRIMARY
 *   certificate:
 *     type: gcp:certificatemanager:Certificate
 *     properties:
 *       name: cert-map-entry
 *       description: The default cert
 *       scope: DEFAULT
 *       managed:
 *         domains:
 *           - ${instance.domain}
 *           - ${instance2.domain}
 *         dnsAuthorizations:
 *           - ${instance.id}
 *           - ${instance2.id}
 *   instance:
 *     type: gcp:certificatemanager:DnsAuthorization
 *     properties:
 *       name: dns-auth
 *       description: The default dnss
 *       domain: subdomain.hashicorptest.com
 *   instance2:
 *     type: gcp:certificatemanager:DnsAuthorization
 *     properties:
 *       name: dns-auth2
 *       description: The default dnss
 *       domain: subdomain2.hashicorptest.com
 * ```
 * 
 * ## Import
 * CertificateMapEntry can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/certificateMaps/{{map}}/certificateMapEntries/{{name}}`
 * * `{{project}}/{{map}}/{{name}}`
 * * `{{map}}/{{name}}`
 * When using the `pulumi import` command, CertificateMapEntry can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:certificatemanager/certificateMapEntry:CertificateMapEntry default projects/{{project}}/locations/global/certificateMaps/{{map}}/certificateMapEntries/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:certificatemanager/certificateMapEntry:CertificateMapEntry default {{project}}/{{map}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:certificatemanager/certificateMapEntry:CertificateMapEntry default {{map}}/{{name}}
 * ```
 */
public class CertificateMapEntry internal constructor(
    override val javaResource: com.pulumi.gcp.certificatemanager.CertificateMapEntry,
) : KotlinCustomResource(javaResource, CertificateMapEntryMapper) {
    /**
     * A set of Certificates defines for the given hostname.
     * There can be defined up to fifteen certificates in each Certificate Map Entry.
     * Each certificate must match pattern projects/*/locations/*/certificates/*.
     * */*/*/
     */
    public val certificates: Output>
        get() = javaResource.certificates().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Creation timestamp of a Certificate Map Entry. Timestamp in RFC3339 UTC "Zulu" format,
     * with nanosecond resolution and up to nine fractional digits.
     * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * A human-readable description of the resource.
     */
    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>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * A Hostname (FQDN, e.g. example.com) or a wildcard hostname expression (*.example.com)
     * for a set of hostnames with common suffix. Used as Server Name Indication (SNI) for
     * selecting a proper certificate.
     */
    public val hostname: Output?
        get() = javaResource.hostname().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Set of labels associated with a Certificate Map Entry.
     * An object containing a list of "key": value pairs.
     * Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.
     * **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.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * A map entry that is inputted into the cetrificate map
     * - - -
     */
    public val map: Output
        get() = javaResource.map().applyValue({ args0 -> args0 })

    /**
     * A predefined matcher for particular cases, other than SNI selection
     */
    public val matcher: Output?
        get() = javaResource.matcher().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * A user-defined name of the Certificate Map Entry. Certificate Map Entry
     * names must be unique globally and match pattern
     * 'projects/*/locations/*/certificateMaps/*/certificateMapEntries/*'
     * */*/*/*/
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * A serving state of this Certificate Map Entry.
     */
    public val state: Output
        get() = javaResource.state().applyValue({ args0 -> args0 })

    /**
     * Update timestamp of a Certificate Map Entry. Timestamp in RFC3339 UTC "Zulu" format,
     * with nanosecond resolution and up to nine fractional digits.
     * Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })
}

public object CertificateMapEntryMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.certificatemanager.CertificateMapEntry::class == javaResource::class

    override fun map(javaResource: Resource): CertificateMapEntry = CertificateMapEntry(
        javaResource
            as com.pulumi.gcp.certificatemanager.CertificateMapEntry,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy