|
|
@ -107,6 +107,11 @@ keys:
|
|
|
|
type: str
|
|
|
|
type: str
|
|
|
|
returned: always
|
|
|
|
returned: always
|
|
|
|
sample: false
|
|
|
|
sample: false
|
|
|
|
|
|
|
|
enable_key_rotation:
|
|
|
|
|
|
|
|
description: Whether the automatically key rotation every year is enabled.
|
|
|
|
|
|
|
|
type: bool
|
|
|
|
|
|
|
|
returned: always
|
|
|
|
|
|
|
|
sample: false
|
|
|
|
aliases:
|
|
|
|
aliases:
|
|
|
|
description: list of aliases associated with the key
|
|
|
|
description: list of aliases associated with the key
|
|
|
|
type: list
|
|
|
|
type: list
|
|
|
@ -284,6 +289,12 @@ def get_key_policy_with_backoff(connection, key_id, policy_name):
|
|
|
|
return connection.get_key_policy(KeyId=key_id, PolicyName=policy_name)
|
|
|
|
return connection.get_key_policy(KeyId=key_id, PolicyName=policy_name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@AWSRetry.backoff(tries=5, delay=5, backoff=2.0)
|
|
|
|
|
|
|
|
def get_enable_key_rotation_with_backoff(connection, key_id):
|
|
|
|
|
|
|
|
current_rotation_status = connection.get_key_rotation_status(KeyId=key_id)
|
|
|
|
|
|
|
|
return current_rotation_status.get('KeyRotationEnabled')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_kms_tags(connection, module, key_id):
|
|
|
|
def get_kms_tags(connection, module, key_id):
|
|
|
|
# Handle pagination here as list_resource_tags does not have
|
|
|
|
# Handle pagination here as list_resource_tags does not have
|
|
|
|
# a paginator
|
|
|
|
# a paginator
|
|
|
@ -360,6 +371,7 @@ def get_key_details(connection, module, key_id, tokens=None):
|
|
|
|
exception=traceback.format_exc(),
|
|
|
|
exception=traceback.format_exc(),
|
|
|
|
**camel_dict_to_snake_dict(e.response))
|
|
|
|
**camel_dict_to_snake_dict(e.response))
|
|
|
|
result['aliases'] = aliases.get(result['KeyId'], [])
|
|
|
|
result['aliases'] = aliases.get(result['KeyId'], [])
|
|
|
|
|
|
|
|
result['enable_key_rotation'] = get_enable_key_rotation_with_backoff(connection, key_id)
|
|
|
|
|
|
|
|
|
|
|
|
if module.params.get('pending_deletion'):
|
|
|
|
if module.params.get('pending_deletion'):
|
|
|
|
return camel_dict_to_snake_dict(result)
|
|
|
|
return camel_dict_to_snake_dict(result)
|
|
|
|