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

com.pulumi.alicloud.kms.kotlin.AliasArgs.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: 3.62.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.alicloud.kms.kotlin

import com.pulumi.alicloud.kms.AliasArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Create an alias for the master key (CMK).
 * > **NOTE:** Available since v1.77.0+.
 * ## Example Usage
 * Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as alicloud from "@pulumi/alicloud";
 * const _this = new alicloud.kms.Key("this", {pendingWindowInDays: 7});
 * const thisAlias = new alicloud.kms.Alias("this", {
 *     aliasName: "alias/example_kms_alias",
 *     keyId: _this.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_alicloud as alicloud
 * this = alicloud.kms.Key("this", pending_window_in_days=7)
 * this_alias = alicloud.kms.Alias("this",
 *     alias_name="alias/example_kms_alias",
 *     key_id=this.id)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AliCloud = Pulumi.AliCloud;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @this = new AliCloud.Kms.Key("this", new()
 *     {
 *         PendingWindowInDays = 7,
 *     });
 *     var thisAlias = new AliCloud.Kms.Alias("this", new()
 *     {
 *         AliasName = "alias/example_kms_alias",
 *         KeyId = @this.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/kms"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		this, err := kms.NewKey(ctx, "this", &kms.KeyArgs{
 * 			PendingWindowInDays: pulumi.Int(7),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = kms.NewAlias(ctx, "this", &kms.AliasArgs{
 * 			AliasName: pulumi.String("alias/example_kms_alias"),
 * 			KeyId:     this.ID(),
 * 		})
 * 		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.alicloud.kms.Key;
 * import com.pulumi.alicloud.kms.KeyArgs;
 * import com.pulumi.alicloud.kms.Alias;
 * import com.pulumi.alicloud.kms.AliasArgs;
 * 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 this_ = new Key("this", KeyArgs.builder()
 *             .pendingWindowInDays(7)
 *             .build());
 *         var thisAlias = new Alias("thisAlias", AliasArgs.builder()
 *             .aliasName("alias/example_kms_alias")
 *             .keyId(this_.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   this:
 *     type: alicloud:kms:Key
 *     properties:
 *       pendingWindowInDays: 7
 *   thisAlias:
 *     type: alicloud:kms:Alias
 *     name: this
 *     properties:
 *       aliasName: alias/example_kms_alias
 *       keyId: ${this.id}
 * ```
 * 
 * ## Import
 * KMS alias can be imported using the id, e.g.
 * ```sh
 * $ pulumi import alicloud:kms/alias:Alias example alias/test_kms_alias
 * ```
 * @property aliasName The alias of CMK. `Encrypt`、`GenerateDataKey`、`DescribeKey` can be called using aliases. Length of characters other than prefixes: minimum length of 1 character and maximum length of 255 characters. Must contain prefix `alias/`.
 * @property keyId The id of the key.
 * > **NOTE:** Each alias represents only one master key(CMK).
 * > **NOTE:** Within an area of the same user, alias is not reproducible.
 * > **NOTE:** UpdateAlias can be used to update the mapping relationship between alias and master key(CMK).
 */
public data class AliasArgs(
    public val aliasName: Output? = null,
    public val keyId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.alicloud.kms.AliasArgs =
        com.pulumi.alicloud.kms.AliasArgs.builder()
            .aliasName(aliasName?.applyValue({ args0 -> args0 }))
            .keyId(keyId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AliasArgs].
 */
@PulumiTagMarker
public class AliasArgsBuilder internal constructor() {
    private var aliasName: Output? = null

    private var keyId: Output? = null

    /**
     * @param value The alias of CMK. `Encrypt`、`GenerateDataKey`、`DescribeKey` can be called using aliases. Length of characters other than prefixes: minimum length of 1 character and maximum length of 255 characters. Must contain prefix `alias/`.
     */
    @JvmName("yruamdwfgoocqayh")
    public suspend fun aliasName(`value`: Output) {
        this.aliasName = value
    }

    /**
     * @param value The id of the key.
     * > **NOTE:** Each alias represents only one master key(CMK).
     * > **NOTE:** Within an area of the same user, alias is not reproducible.
     * > **NOTE:** UpdateAlias can be used to update the mapping relationship between alias and master key(CMK).
     */
    @JvmName("xcpgrvfopwddphif")
    public suspend fun keyId(`value`: Output) {
        this.keyId = value
    }

    /**
     * @param value The alias of CMK. `Encrypt`、`GenerateDataKey`、`DescribeKey` can be called using aliases. Length of characters other than prefixes: minimum length of 1 character and maximum length of 255 characters. Must contain prefix `alias/`.
     */
    @JvmName("rcybtgchjcduoxag")
    public suspend fun aliasName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.aliasName = mapped
    }

    /**
     * @param value The id of the key.
     * > **NOTE:** Each alias represents only one master key(CMK).
     * > **NOTE:** Within an area of the same user, alias is not reproducible.
     * > **NOTE:** UpdateAlias can be used to update the mapping relationship between alias and master key(CMK).
     */
    @JvmName("gisjgvtxaegmffok")
    public suspend fun keyId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.keyId = mapped
    }

    internal fun build(): AliasArgs = AliasArgs(
        aliasName = aliasName,
        keyId = keyId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy