Skip to content

Commit

Permalink
Fix for aws_kms_info with external/custom key store keys (ansible-col…
Browse files Browse the repository at this point in the history
…lections#311)

* Fix for aws_kms_info with external/custom key store keys
* Added changelog fragment
  • Loading branch information
PandaWill authored Nov 28, 2020
1 parent 60a4758 commit 44ad137
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/311-fix-aws_kms_info-external-keys.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- aws_kms_info - fixed incompatibility with external and custom key-store keys. The module was attempting to call `GetKeyRotationStatus`, which raises `UnsupportedOperationException` for these key types (https://github.com/ansible-collections/community.aws/pull/311).
6 changes: 5 additions & 1 deletion plugins/modules/aws_kms_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ def get_key_details(connection, module, key_id, tokens=None):
exception=traceback.format_exc(),
**camel_dict_to_snake_dict(e.response))
result['aliases'] = aliases.get(result['KeyId'], [])
result['enable_key_rotation'] = get_enable_key_rotation_with_backoff(connection, key_id)

if result['Origin'] == 'AWS_KMS':
result['enable_key_rotation'] = get_enable_key_rotation_with_backoff(connection, key_id)
else:
result['enable_key_rotation'] = None

if module.params.get('pending_deletion'):
return camel_dict_to_snake_dict(result)
Expand Down

0 comments on commit 44ad137

Please sign in to comment.