[aws] Allow CloudWatch Log Group retention to be changed when log group exists (#43752)

* fix bugs #42028 and #43735
This commit is contained in:
Willian Ricardo 2018-08-07 17:06:06 -03:00 committed by Ryan Brown
parent d7009abee4
commit 29f2bf651e

View file

@ -257,6 +257,14 @@ def main():
tags=module.params['tags'],
retention=module.params['retention'],
module=module)
elif found_log_group:
if module.params['retention'] != found_log_group['retentionInDays']:
changed = True
input_retention_policy(client=logs,
log_group_name=module.params['log_group_name'],
retention=module.params['retention'],
module=module)
found_log_group['retentionInDays'] = module.params['retention']
module.exit_json(changed=changed, **camel_dict_to_snake_dict(found_log_group))