AliasArgs

data class AliasArgs(val name: Output<String>? = null, val namePrefix: Output<String>? = null, val targetKeyId: Output<String>? = null) : ConvertibleToJava<AliasArgs>

Provides an alias for a KMS customer master key. AWS Console enforces 1-to-1 mapping between aliases & keys, but API (hence this provider too) allows you to create as many aliases as the account limits allow you.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kms.Key;
import com.pulumi.aws.kms.Alias;
import com.pulumi.aws.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 key = new Key("key");
var alias = new Alias("alias", AliasArgs.builder()
.targetKeyId(key.keyId())
.build());
}
}

Import

KMS aliases can be imported using the name, e.g.,

$ pulumi import aws:kms/alias:Alias a alias/my-key-alias

Constructors

Link copied to clipboard
constructor(name: Output<String>? = null, namePrefix: Output<String>? = null, targetKeyId: Output<String>? = null)

Properties

Link copied to clipboard
val name: Output<String>? = null

The display name of the alias. The name must start with the word "alias" followed by a forward slash (alias/)

Link copied to clipboard
val namePrefix: Output<String>? = null

Creates an unique alias beginning with the specified prefix. The name must start with the word "alias" followed by a forward slash (alias/). Conflicts with name.

Link copied to clipboard
val targetKeyId: Output<String>? = null

Identifier for the key for which the alias is for, can be either an ARN or key_id.

Functions

Link copied to clipboard
open override fun toJava(): AliasArgs