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

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

package com.pulumi.gcp.compute.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

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

    public var args: CaExternalAccountKeyArgs = CaExternalAccountKeyArgs()

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

/**
 * A representation of an ExternalAccountKey used for external account binding within ACME.
 * To get more information about ExternalAccountKey, see:
 * * [API documentation](https://cloud.google.com/certificate-manager/docs/reference/public-ca/rest/v1/projects.locations.externalAccountKeys/create)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/certificate-manager/docs/public-ca)
 *     * [Request EAB key ID and HMAC](https://cloud.google.com/certificate-manager/docs/public-ca-tutorial#request-key-hmac)
 *     * [Request Certificate Using Public CA](https://cloud.google.com/certificate-manager/docs/public-ca-tutorial)
 * > **Warning:** This resource is create-only and could not be read from the API.
 * On delete, the resource would be removed from the state.
 * You must use an EAB secret within 7 days of obtaining it.
 * The EAB secret is invalidated if you don't use it within 7 days.
 * The ACME account registered by using an EAB secret has no expiration.
 * ## Example Usage
 * ### Public Ca External Account Key
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const prod = new gcp.compute.CaExternalAccountKey("prod", {project: "my-project-name"});
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * prod = gcp.compute.CaExternalAccountKey("prod", project="my-project-name")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var prod = new Gcp.Compute.CaExternalAccountKey("prod", new()
 *     {
 *         Project = "my-project-name",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := compute.NewCaExternalAccountKey(ctx, "prod", &compute.CaExternalAccountKeyArgs{
 * 			Project: pulumi.String("my-project-name"),
 * 		})
 * 		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.compute.CaExternalAccountKey;
 * import com.pulumi.gcp.compute.CaExternalAccountKeyArgs;
 * 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 prod = new CaExternalAccountKey("prod", CaExternalAccountKeyArgs.builder()
 *             .project("my-project-name")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   prod:
 *     type: gcp:compute:CaExternalAccountKey
 *     properties:
 *       project: my-project-name
 * ```
 * 
 * ## Import
 * This resource does not support import.
 */
public class CaExternalAccountKey internal constructor(
    override val javaResource: com.pulumi.gcp.compute.CaExternalAccountKey,
) : KotlinCustomResource(javaResource, CaExternalAccountKeyMapper) {
    /**
     * Base64-URL-encoded HS256 key. It is generated by the PublicCertificateAuthorityService
     * when the ExternalAccountKey is created.
     * **Note**: This property is sensitive and will not be displayed in the plan.
     */
    public val b64MacKey: Output
        get() = javaResource.b64MacKey().applyValue({ args0 -> args0 })

    /**
     * It is generated by the PublicCertificateAuthorityService when the ExternalAccountKey is created.
     * **Note**: This property is sensitive and will not be displayed in the plan.
     */
    public val keyId: Output
        get() = javaResource.keyId().applyValue({ args0 -> args0 })

    /**
     * Location for the externalAccountKey. Currently only `global` is supported.
     */
    public val location: Output?
        get() = javaResource.location().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * Resource name. projects/{project}/locations/{location}/externalAccountKeys/{keyId}.
     */
    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 })
}

public object CaExternalAccountKeyMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.compute.CaExternalAccountKey::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy