Skip to content

Commit

Permalink
[aws] Allow CloudWatch Log Group retention to be changed when log gro…
Browse files Browse the repository at this point in the history
…up exists (ansible#43752)

* fix bugs ansible#42028 and ansible#43735
  • Loading branch information
willricardo authored and ryansb committed Aug 7, 2018
1 parent d7009ab commit 29f2bf6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 29f2bf6

Please sign in to comment.