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
Fixed aws_cloudwatch_log_group table for the error key column is not globally unique Closes #1975 #1976
Conversation
…globally unique Closes #1975
Hi @bryanburke, I anticipate this fix will resolve the issue. I've tested the code changes with the following test cases, including creating two Log Groups with the same name in different regions within an account. Case 1: By providing
Case 2: By providing
Case 3: By providing
Could you please give it a try by checking out the PR branch ('issue-1975')? Please let us know if you encounter any other issues. Steps for checkout
Thank you for your interest in Steampipe. We appreciate it! |
@ParthaI I just tested the plugin built from this branch, and the issue is resolved. Thanks! |
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.
@ParthaI I believe we need to update the table docs to reflect the usage of both the name
and the region
column.
Please let me know if you have questions. Thanks!!
@@ -176,19 +189,20 @@ func listCloudwatchLogGroups(ctx context.Context, d *plugin.QueryData, _ *plugin | |||
//// HYDRATE FUNCTIONS | |||
|
|||
func getCloudwatchLogGroup(ctx context.Context, d *plugin.QueryData, _ *plugin.HydrateData) (interface{}, error) { | |||
name := d.EqualsQualString("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.
@ParthaI shouldn't we be adding an additional check for the region
column as well?
If a user does not pass in the region along with the name, then we should return nil
.
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.
@misraved, in accordance with our design, we utilize the SupportedRegionMatrix.
Here's how it works:
- If a user queries without specifying the
region
but includes thename
, we will perform a list API call. This approach ensures that there will be no errors such as 'key column is not globally unique'. - Conversely, if the
region
value is specified along with thename
, a Get API call will be executed, but only for the specifiedregion
.
Note: We can have multiple LogGroups with same name but in different region. Therefore, our approach ensures that users receive actual results rather than an empty row in such cases.
Integration test logs
Logs
Example query results
Results