-
Notifications
You must be signed in to change notification settings - Fork 105
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
Added a default limit = 1
value to aws_cloudwatch_log_group.rb
#928
Added a default limit = 1
value to aws_cloudwatch_log_group.rb
#928
Conversation
…at can be overridden. Updated associated documentation. Signed-off-by: Jedidiah Foster <[email protected]>
✅ Deploy Preview for inspec-aws ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Unsure if unit / integration tests need to be modified. I believe the existing tests for the resource will pass. |
Any updates on this request? |
In a particular region, we cant create two log_groups with the same name. I tried to replicate the issue. I created a cloud-log-group in region ‘us-east-2’ and created another cloud-log-group with the same name in the region 'us-west-2'. Then I tried running the same in both the two regions. Test Checked:
I used the below command to execute the test in different regions: This test I have executed for region 'us-east-2'
This test I have executed for region 'us-west-2'
|
The issue isn't two log groups with the same name. It's two log groups that start with the same prefix. This information is in my description. To replicate the issue, try creating a log group called It will fail, because there are now two log groups with a prefix of My submitted fix will prevent this from happening, as it would default to only looking at the first match. Here is sample output of the output from running a basic
|
Thanks got the problem. |
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.
LGTM
Description
The resource is using the
describe_log_groups
api call, which is actually doing a prefix lookup. This means that it can easily return multiple log groups that have the same prefix.For example, if I have a log group called
/my-environment/my-app
that I want to check, but I also have a log group called/my-environment/my-app-testing
, it is impossible to check the/my-environment/my-app
log group because it returns multiple groups.This change includes adding a defaulted
limit: 1
value to the call. That will return only the first log group match, which in examples as shown above, will be the exact match.It allows for an override if desired by simply adding a
limit: value
option to the resource.I believe that since this is a singular resource, that this new behavior is more in line with expected results.
Issues Resolved
Resolves issue #885
Check List
Please fill box or appropriate ([x]) or mark N/A.
rake lint
passes