-
Notifications
You must be signed in to change notification settings - Fork 107
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
feat(table): add aws_rds_db_maintenance_action #2430
base: main
Are you sure you want to change the base?
feat(table): add aws_rds_db_maintenance_action #2430
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.
Hello @fyqtian, I’ve added a few initial review comments. When you get a chance, could you please take a look?
Additionally, it would be great to include more example queries in the documentation.
{ | ||
Name: "arn", | ||
Description: "The Amazon Resource Name (ARN) of the resource that the pending maintenance action applies to.", | ||
Type: proto.ColumnType_STRING, | ||
Transform: transform.FromField("ResourceIdentifier"), | ||
}, |
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.
{ | |
Name: "arn", | |
Description: "The Amazon Resource Name (ARN) of the resource that the pending maintenance action applies to.", | |
Type: proto.ColumnType_STRING, | |
Transform: transform.FromField("ResourceIdentifier"), | |
}, | |
{ | |
Name: "resource_identifier", | |
Description: "The ARN of the resource that has pending maintenance actions.", | |
Type: proto.ColumnType_STRING, | |
}, |
The aws_rds_db_maintenance_action
table is designed to display pending actions for clusters.
As per table development standards, if maintenance_action
follows a standard ARN format, we should include an ARN column. Otherwise, the column name should align with the API response.
plugin.Logger(ctx).Error("aws_rds_db_maintenance_action.listMaintenanceAction", "connection_error", err) | ||
return nil, err | ||
} | ||
var maxItems = calculateMaxLimit[int32](100, d) |
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 agree that these changes will help optimize the code and make it reusable for tables with a minimum limit of 1 per page.
I also noticed that the minimum value for this is 20. You can find more details here: AWS Documentation.
To maintain consistency across tables, could you please follow the standards used in other tables?
type result struct { | ||
Name string | ||
ResourceIdentifier string | ||
IsCluster bool | ||
types.PendingMaintenanceAction | ||
} |
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.
type result struct { | |
Name string | |
ResourceIdentifier string | |
IsCluster bool | |
types.PendingMaintenanceAction | |
} | |
type result struct { | |
ResourceIdentifier string | |
types.PendingMaintenanceAction | |
} |
Since we don't include columns for attributes that are not directly part of the API response, it would be best to avoid adding them.
Additionally, could we move the custom struct from the function scope to the table scope? This would make it reusable for fetching hydrate data in any child tables if needed.
IsCluster: splitIdentifier[n-2] == "cluster", | ||
PendingMaintenanceAction: detail, | ||
} | ||
d.StreamListItem(ctx, r) |
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.
Please add the context cancellation logic here to ensure that if the context is canceled, the loop terminates immediately.
For example: https://github.com/turbot/steampipe-plugin-aws/blob/main/aws/table_aws_rds_db_cluster.go#L523
Integration test logs
Logs
Example query results
Results