key_rotations
Creates, updates, deletes, gets or lists a key_rotations resource.
Overview
| Name | key_rotations |
| Type | Resource |
| Id | aws.kms.key_rotations |
Fields
The following fields are returned by SELECT queries:
- list_key_rotations
| Name | Datatype | Description |
|---|---|---|
expiration_model | string | Indicates if the key material is configured to automatically expire. There are two possible values for this field: KEY_MATERIAL_EXPIRES and KEY_MATERIAL_DOES_NOT_EXPIRE. For any key material that expires, the expiration date and time is indicated in ValidTo. This field is only present for symmetric encryption KMS keys with EXTERNAL origin. (KEY_MATERIAL_EXPIRES, KEY_MATERIAL_DOES_NOT_EXPIRE) |
import_state | string | Indicates if the key material is currently imported into KMS. It has two possible values: IMPORTED or PENDING_IMPORT. This field is only present for symmetric encryption KMS keys with EXTERNAL origin. (IMPORTED, PENDING_IMPORT) |
key_id | string | Unique identifier of the key. |
key_material_description | string | User-specified description of the key material. This field is only present for symmetric encryption KMS keys with EXTERNAL origin. (pattern: <code>^[a-zA-Z0-9:/_\s.-]+$</code>) |
key_material_id | string | Unique identifier of the key material. (pattern: <code>^[a-f0-9]+$</code>) |
key_material_state | string | There are four possible values for this field: CURRENT, NON_CURRENT, PENDING_MULTI_REGION_IMPORT_AND_ROTATION and PENDING_ROTATION. KMS uses CURRENT key material for both encryption and decryption and NON_CURRENT key material only for decryption. PENDING_ROTATION identifies key material that has been imported for on-demand key rotation but the rotation hasn't completed. The key material state PENDING_MULTI_REGION_IMPORT_AND_ROTATION is unique to multi-region, symmetric encryption keys with imported key material. It indicates key material that has been imported into the primary Region key but not all of the replica Region keys. When this key material is imported in to all of the replica Region keys, the key material state will change to PENDING_ROTATION. Key material in PENDING_MULTI_REGION_IMPORT_AND_ROTATION or PENDING_ROTATION state is not permanently associated with the KMS key. You can delete this key material and import different key material in its place. The PENDING_MULTI_REGION_IMPORT_AND_ROTATION and PENDING_ROTATION values are only used in symmetric encryption keys with imported key material. The other values, CURRENT and NON_CURRENT, are used for all KMS keys that support automatic or on-demand key rotation. (NON_CURRENT, CURRENT, PENDING_ROTATION, PENDING_MULTI_REGION_IMPORT_AND_ROTATION) |
rotation_date | string (date-time) | Date and time that the key material rotation completed. Formatted as Unix time. This field is not present for the first key material or an imported key material in PENDING_ROTATION state. |
rotation_type | string | Identifies whether the key material rotation was a scheduled automatic rotation or an on-demand rotation. This field is not present for the first key material or an imported key material in PENDING_ROTATION state. (AUTOMATIC, ON_DEMAND) |
valid_to | string (date-time) | Date and time at which the key material expires. This field is only present for symmetric encryption KMS keys with EXTERNAL origin in rotation list entries with an ExpirationModel value of KEY_MATERIAL_EXPIRES. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_key_rotations | select | region | Returns information about the key materials associated with the specified KMS key. You can use the optional IncludeKeyMaterial parameter to control which key materials are included in the response. You must specify the KMS key in all requests. You can refine the key rotations list by limiting the number of rotations returned. For detailed information about automatic and on-demand key rotations, see Rotate KMS keys in the Key Management Service Developer Guide. Cross-account use: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account. Required permissions: kms:ListKeyRotations (key policy) Related operations: EnableKeyRotation DeleteImportedKeyMaterial DisableKeyRotation GetKeyRotationStatus ImportKeyMaterial RotateKeyOnDemand Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_key_rotations
Returns information about the key materials associated with the specified KMS key. You can use the optional IncludeKeyMaterial parameter to control which key materials are included in the response. You must specify the KMS key in all requests. You can refine the key rotations list by limiting the number of rotations returned. For detailed information about automatic and on-demand key rotations, see Rotate KMS keys in the Key Management Service Developer Guide. Cross-account use: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account. Required permissions: kms:ListKeyRotations (key policy) Related operations: EnableKeyRotation DeleteImportedKeyMaterial DisableKeyRotation GetKeyRotationStatus ImportKeyMaterial RotateKeyOnDemand Eventual consistency: The KMS API follows an eventual consistency model. For more information, see KMS eventual consistency.
SELECT
expiration_model,
import_state,
key_id,
key_material_description,
key_material_id,
key_material_state,
rotation_date,
rotation_type,
valid_to
FROM aws.kms.key_rotations
WHERE region = '{{ region }}' -- required
;