Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lstone
Copy link

@lstone lstone commented Oct 11, 2022

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".

Copy link
Member

@kichik kichik left a 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'
Copy link
Member

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)
Copy link
Member

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)
Copy link
Member

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
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants