AWS Native is in preview. AWS Classic is fully supported.
aws-native.kms.Alias
Explore with Pulumi AI
AWS Native is in preview. AWS Classic is fully supported.
The AWS::KMS::Alias
resource specifies a display name for a KMS key. You can use an alias to identify a KMS key in the KMS console, in the DescribeKey operation, and in cryptographic operations, such as Decrypt and GenerateDataKey.
Adding, deleting, or updating an alias can allow or deny permission to the KMS key. For details, see ABAC for in the Developer Guide.
Using an alias to refer to a KMS key can help you simplify key management. For example, an alias in your code can be associated with different KMS keys in different AWS-Regions. For more information, see Using aliases in the Developer Guide.
When specifying an alias, observe the following rules.
- Each alias is associated with one KMS key, but multiple aliases can be associated with the same KMS key.
- The alias and its associated KMS key must be in the same AWS-account and Region.
- The alias name must be unique in the AWS-account and Region. However, you can create aliases with the same name in different AWS-Regions. For example, you can have an
alias/projectKey
in multiple Regions, each of which is associated with a KMS key in its Region. - Each alias name must begin with
alias/
followed by a name, such asalias/exampleKey
. The alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). Alias names cannot begin withalias/aws/
. That alias name prefix is reserved for .
Regions KMS CloudFormation resources are available in all AWS-Regions in which KMS and CFN are supported.
Create Alias Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Alias(name: string, args: AliasArgs, opts?: CustomResourceOptions);
@overload
def Alias(resource_name: str,
args: AliasArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Alias(resource_name: str,
opts: Optional[ResourceOptions] = None,
target_key_id: Optional[str] = None,
alias_name: Optional[str] = None)
func NewAlias(ctx *Context, name string, args AliasArgs, opts ...ResourceOption) (*Alias, error)
public Alias(string name, AliasArgs args, CustomResourceOptions? opts = null)
type: aws-native:kms:Alias
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- 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.
- args AliasArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control 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.
- name String
- The unique name of the resource.
- args AliasArgs
- The arguments to resource properties.
- options 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 Architecture and Concepts docs.
Inputs
The Alias resource accepts the following input properties:
- Target
Key stringId Associates the alias with the specified . The KMS key must be in the same AWS-account and Region. A valid key ID is required. If you supply a null or empty string value, this operation returns an error. For help finding the key ID and ARN, see Finding the key ID and ARN in the Developer Guide. Specify the key ID or the key ARN of the KMS key. For example:
- Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
- Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
- Key ID:
- Alias
Name string - Specifies the alias name. This value must begin with
alias/
followed by a name, such asalias/ExampleAlias
. If you change the value of theAliasName
property, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC). The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin withalias/aws/
. Thealias/aws/
prefix is reserved for .
- Target
Key stringId Associates the alias with the specified . The KMS key must be in the same AWS-account and Region. A valid key ID is required. If you supply a null or empty string value, this operation returns an error. For help finding the key ID and ARN, see Finding the key ID and ARN in the Developer Guide. Specify the key ID or the key ARN of the KMS key. For example:
- Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
- Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
- Key ID:
- Alias
Name string - Specifies the alias name. This value must begin with
alias/
followed by a name, such asalias/ExampleAlias
. If you change the value of theAliasName
property, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC). The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin withalias/aws/
. Thealias/aws/
prefix is reserved for .
- target
Key StringId Associates the alias with the specified . The KMS key must be in the same AWS-account and Region. A valid key ID is required. If you supply a null or empty string value, this operation returns an error. For help finding the key ID and ARN, see Finding the key ID and ARN in the Developer Guide. Specify the key ID or the key ARN of the KMS key. For example:
- Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
- Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
- Key ID:
- alias
Name String - Specifies the alias name. This value must begin with
alias/
followed by a name, such asalias/ExampleAlias
. If you change the value of theAliasName
property, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC). The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin withalias/aws/
. Thealias/aws/
prefix is reserved for .
- target
Key stringId Associates the alias with the specified . The KMS key must be in the same AWS-account and Region. A valid key ID is required. If you supply a null or empty string value, this operation returns an error. For help finding the key ID and ARN, see Finding the key ID and ARN in the Developer Guide. Specify the key ID or the key ARN of the KMS key. For example:
- Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
- Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
- Key ID:
- alias
Name string - Specifies the alias name. This value must begin with
alias/
followed by a name, such asalias/ExampleAlias
. If you change the value of theAliasName
property, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC). The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin withalias/aws/
. Thealias/aws/
prefix is reserved for .
- target_
key_ strid Associates the alias with the specified . The KMS key must be in the same AWS-account and Region. A valid key ID is required. If you supply a null or empty string value, this operation returns an error. For help finding the key ID and ARN, see Finding the key ID and ARN in the Developer Guide. Specify the key ID or the key ARN of the KMS key. For example:
- Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
- Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
- Key ID:
- alias_
name str - Specifies the alias name. This value must begin with
alias/
followed by a name, such asalias/ExampleAlias
. If you change the value of theAliasName
property, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC). The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin withalias/aws/
. Thealias/aws/
prefix is reserved for .
- target
Key StringId Associates the alias with the specified . The KMS key must be in the same AWS-account and Region. A valid key ID is required. If you supply a null or empty string value, this operation returns an error. For help finding the key ID and ARN, see Finding the key ID and ARN in the Developer Guide. Specify the key ID or the key ARN of the KMS key. For example:
- Key ID:
1234abcd-12ab-34cd-56ef-1234567890ab
- Key ARN:
arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.
- Key ID:
- alias
Name String - Specifies the alias name. This value must begin with
alias/
followed by a name, such asalias/ExampleAlias
. If you change the value of theAliasName
property, the existing alias is deleted and a new alias is created for the specified KMS key. This change can disrupt applications that use the alias. It can also allow or deny access to a KMS key affected by attribute-based access control (ABAC). The alias must be string of 1-256 characters. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-). The alias name cannot begin withalias/aws/
. Thealias/aws/
prefix is reserved for .
Outputs
All input properties are implicitly available as output properties. Additionally, the Alias resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
AWS Native is in preview. AWS Classic is fully supported.