2015-10-26 15:47:35 +01:00
|
|
|
---
|
|
|
|
layout: "aws"
|
|
|
|
page_title: "AWS: aws_kms_alias"
|
|
|
|
sidebar_current: "docs-aws-resource-kms-alias"
|
|
|
|
description: |-
|
|
|
|
Provides a display name for a customer master key.
|
|
|
|
---
|
|
|
|
|
|
|
|
# aws\_kms\_alias
|
|
|
|
|
|
|
|
Provides an alias for a KMS customer master key. AWS Console enforces 1-to-1 mapping between aliases & keys,
|
|
|
|
but API (hence Terraform too) allows you to create as many aliases as
|
|
|
|
the [account limits](http://docs.aws.amazon.com/kms/latest/developerguide/limits.html) allow you.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
2017-02-18 23:48:50 +01:00
|
|
|
resource "aws_kms_key" "a" {}
|
2015-10-26 15:47:35 +01:00
|
|
|
|
|
|
|
resource "aws_kms_alias" "a" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "alias/my-key-alias"
|
|
|
|
target_key_id = "${aws_kms_key.a.key_id}"
|
2015-10-26 15:47:35 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2016-03-12 00:31:57 +01:00
|
|
|
|
|
|
|
* `name` - (Optional) The display name of the alias. The name must start with the word "alias" followed by a forward slash (alias/)
|
2017-02-18 23:48:50 +01:00
|
|
|
* `name_prefix` - (Optional) Creates an unique alias beginning with the specified prefix.
|
2016-03-12 00:31:57 +01:00
|
|
|
The name must start with the word "alias" followed by a forward slash (alias/). Conflicts with `name`.
|
2015-10-26 15:47:35 +01:00
|
|
|
* `target_key_id` - (Required) Identifier for the key for which the alias is for, can be either an ARN or key_id.
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `arn` - The Amazon Resource Name (ARN) of the key alias.
|