Resource: aws_kms_key

Manages a single-Region or multi-Region primary KMS key.

Example Usage

resource "aws_kms_key" "a" {
  description             = "KMS key 1"
  deletion_window_in_days = 10
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Timeouts

Configuration options:

Import

In Terraform v1.5.0 and later, use an import block to import KMS Keys using the id. For example:

import {
  to = aws_kms_key.a
  id = "1234abcd-12ab-34cd-56ef-1234567890ab"
}

Using terraform import, import KMS Keys using the id. For example:

% terraform import aws_kms_key.a 1234abcd-12ab-34cd-56ef-1234567890ab