-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Archive Cloudwatch Log Groups by Tag and update Python to 3.9 #11
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea. Thanks!
@@ -199,6 +202,10 @@ Parameters: | |||
Description: Prefix to match against log group that should be exported (leave | |||
empty to export all log groups) | |||
Type: String | |||
LogGroupTagName: | |||
Default: 'archive_log_group_to_s3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the default should be empty to keep backwards compatibility.
tags_in_group_response = logs_client.list_tags_log_group( | ||
logGroupName = log_group_name | ||
) | ||
print("tags_in_group_response", tags_in_group_response) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need this print?
print("tags_in_group_response", tags_in_group_response) | ||
for tag in tags_in_group_response["tags"]: | ||
if tag == "${LogGroupTagName}": | ||
subscribe(log_group_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a break
here just in case? Don't want for it to be possible to get double subscribe (which I think results in an exception).
@@ -737,7 +753,7 @@ Resources: | |||
Fn::GetAtt: | |||
- LogSubscriberRole | |||
- Arn | |||
Runtime: python3.6 | |||
Runtime: python3.9 | |||
Timeout: 300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's increase the timeout since we're doing much more.
Added LogGroupTagName parameter that allows users to define a tag that can be added to a Log Group to mark it for Archiving to S3 bucket. By default, tag is "archive_log_group_to_s3".