Alias

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

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var key = new Aws.Kms.Key("key", new Aws.Kms.KeyArgs
        {
        });
        var @alias = new Aws.Kms.Alias("alias", new Aws.Kms.AliasArgs
        {
            TargetKeyId = key.KeyId,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/kms"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        key, err := kms.NewKey(ctx, "key", nil)
        if err != nil {
            return err
        }
        _, err = kms.NewAlias(ctx, "alias", &kms.AliasArgs{
            TargetKeyId: key.KeyId,
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

key = aws.kms.Key("key")
alias = aws.kms.Alias("alias", target_key_id=key.key_id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const key = new aws.kms.Key("a", {});
const alias = new aws.kms.Alias("a", {
    targetKeyId: key.keyId,
});

Create a Alias Resource

new Alias(name: string, args: AliasArgs, opts?: CustomResourceOptions);
def Alias(resource_name, opts=None, name=None, name_prefix=None, target_key_id=None, __props__=None);
func NewAlias(ctx *Context, name string, args AliasArgs, opts ...ResourceOption) (*Alias, error)
public Alias(string name, AliasArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AliasArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AliasArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AliasArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Alias Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Alias resource accepts the following input properties:

TargetKeyId string

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

Name string

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

NamePrefix string

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.

TargetKeyId string

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

Name string

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

NamePrefix string

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.

targetKeyId string

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

name string

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

namePrefix string

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.

target_key_id str

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

name str

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

name_prefix str

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.

Outputs

All input properties are implicitly available as output properties. Additionally, the Alias resource produces the following output properties:

Arn string

The Amazon Resource Name (ARN) of the key alias.

Id string
The provider-assigned unique ID for this managed resource.
TargetKeyArn string

The Amazon Resource Name (ARN) of the target key identifier.

Arn string

The Amazon Resource Name (ARN) of the key alias.

Id string
The provider-assigned unique ID for this managed resource.
TargetKeyArn string

The Amazon Resource Name (ARN) of the target key identifier.

arn string

The Amazon Resource Name (ARN) of the key alias.

id string
The provider-assigned unique ID for this managed resource.
targetKeyArn string

The Amazon Resource Name (ARN) of the target key identifier.

arn str

The Amazon Resource Name (ARN) of the key alias.

id str
The provider-assigned unique ID for this managed resource.
target_key_arn str

The Amazon Resource Name (ARN) of the target key identifier.

Look up an Existing Alias Resource

Get an existing Alias resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AliasState, opts?: CustomResourceOptions): Alias
static get(resource_name, id, opts=None, arn=None, name=None, name_prefix=None, target_key_arn=None, target_key_id=None, __props__=None);
func GetAlias(ctx *Context, name string, id IDInput, state *AliasState, opts ...ResourceOption) (*Alias, error)
public static Alias Get(string name, Input<string> id, AliasState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Arn string

The Amazon Resource Name (ARN) of the key alias.

Name string

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

NamePrefix string

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.

TargetKeyArn string

The Amazon Resource Name (ARN) of the target key identifier.

TargetKeyId string

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

Arn string

The Amazon Resource Name (ARN) of the key alias.

Name string

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

NamePrefix string

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.

TargetKeyArn string

The Amazon Resource Name (ARN) of the target key identifier.

TargetKeyId string

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

arn string

The Amazon Resource Name (ARN) of the key alias.

name string

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

namePrefix string

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.

targetKeyArn string

The Amazon Resource Name (ARN) of the target key identifier.

targetKeyId string

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

arn str

The Amazon Resource Name (ARN) of the key alias.

name str

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

name_prefix str

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.

target_key_arn str

The Amazon Resource Name (ARN) of the target key identifier.

target_key_id str

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

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.