Skip to content

Adds Selection Criteria parameter to aws account level logs#289

Open
correnarsprowls wants to merge 1 commit intoDataDog:masterfrom
correnarsprowls:crs-selection-criteria
Open

Adds Selection Criteria parameter to aws account level logs#289
correnarsprowls wants to merge 1 commit intoDataDog:masterfrom
correnarsprowls:crs-selection-criteria

Conversation

@correnarsprowls
Copy link

What does this PR do?

This allows users to enter their own value for SelectionCriteria for the log subscription filter.

Motivation

We created a new log group that we don't want to be forwarded to Datadog

Testing Guidelines

I made these changes to the templates, uploaded them to s3 (with the addition that main.yaml referenced the newly uploaded single-region.yaml) and then used them to add my own SelectionCriteria. It applied cleanly and logs from that log group weren't being sent to datadog anymore.

Additional Notes

I opted for easy readability here and required the entire filter (ex "LogGroupName NOT IN [\"MyLogGroup1\", \"MyLogGroup2\"]", but we could add an ExcludedLogGroup parameter instead and build out the filter. I'm open to suggestions.

I also kept the default value the same as what was hardcoded for SelectionCriteria before. Not sure if that's something you would like to keep or change.

@correnarsprowls correnarsprowls requested a review from a team as a code owner March 10, 2026 18:31
Copy link

@bwebster bwebster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had one question trying to understand what the Default value is used for.

Description: >-
Optional subscription selection criteria.
Type: String
Default: "LogGroupName NOT IN [\"MyLogGroup\", \"MyAnotherLogGroup\"]"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Default used as the actual default value, or use to show an example value? If it becomes the actual default value, maybe we need to move this into the description.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the actual default value. I would prefer the default be a blank string, but that would create drift for other people using the template without SelectionCriteria set.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically I think what we would set it to is !Ref "AWS::NoValue" if no value was given

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