-
Notifications
You must be signed in to change notification settings - Fork 0
feat: added autoscaling results with tags based filters #8
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
Conversation
`resourcegrouptaggingapi` does not support ASG, hence we are using the service based approach and then merging them together for better outputs. Signed-off-by: ishuar <ishansharma887@gmail.com>
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.
Pull Request Overview
This PR enhances autoscaling resource scanning with tag-based filtering capabilities. Since the Resource Groups Tagging API does not support Auto Scaling Groups (ASG), the implementation uses a service-specific approach for autoscaling resources and then merges the results with other tagged resources for comprehensive output.
- Enhanced autoscaling service to support flexible tag filtering (key only, value only, or key-value pairs)
- Implemented hybrid scanning approach combining Resource Groups API with dedicated autoscaling scanning
- Optimized launch configuration scanning to only fetch configurations used by matching ASGs
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| services/autoscaling_service.py | Added comprehensive tag filtering logic for ASGs and launch templates, optimized launch configuration scanning |
| cli.py | Enhanced dry-run output to display different tag filtering modes |
| aws_scanner_lib/scan.py | Modified service-specific autoscaling scan to include tag filtering |
| aws_scanner_lib/resource_groups_utils.py | Implemented hybrid scanning approach with parallel execution of Resource Groups API and autoscaling scans |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| logger.debug("Applying tag filters - key: %s, value: %s", tag_key, tag_value) | ||
|
|
||
| # Show progress to user on separate console (will not conflict with logging or progress bars) | ||
| if logger.is_debug_enabled(): |
Copilot
AI
Oct 1, 2025
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.
The method is_debug_enabled() is not a standard method on Python loggers. Standard Python loggers use isEnabledFor(logging.DEBUG) to check if debug logging is enabled.
| logger.log_aws_operation( | ||
| "autoscaling", | ||
| "describe_multiple", | ||
| region, | ||
| parallel_workers=AUTOSCALING_MAX_WORKERS, |
Copilot
AI
Oct 1, 2025
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.
The method log_aws_operation() is not a standard method on Python loggers. This appears to be a custom method that may not exist on the logger instance.
| logger.log_aws_operation( | |
| "autoscaling", | |
| "describe_multiple", | |
| region, | |
| parallel_workers=AUTOSCALING_MAX_WORKERS, | |
| logger.info( | |
| "AWS operation: service=%s, operation=%s, region=%s, parallel_workers=%d", | |
| "autoscaling", | |
| "describe_multiple", | |
| region, | |
| AUTOSCALING_MAX_WORKERS, |
| except (ClientError, BotoCoreError) as e: | ||
| console.print( | ||
| f"[yellow]Warning: Failed to scan Auto Scaling Groups in {region}: {str(e)}[/yellow]" | ||
| with logger.timer(f"Auto Scaling parallel scan in {region}"): |
Copilot
AI
Oct 1, 2025
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.
The method timer() is not a standard method on Python loggers. This appears to be a custom context manager that may not exist on the logger instance.
| logger.log_error_context( | ||
| e, {"service": "autoscaling", "region": region, "operation": "full_scan"} |
Copilot
AI
Oct 1, 2025
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.
The method log_error_context() is not a standard method on Python loggers. This appears to be a custom method that may not exist on the logger instance.
| logger.log_error_context( | |
| e, {"service": "autoscaling", "region": region, "operation": "full_scan"} | |
| logger.error( | |
| "Error during Auto Scaling scan in %s: %s | Context: %s", | |
| region, str(e), {"service": "autoscaling", "region": region, "operation": "full_scan"} |
Signed-off-by: ishuar <ishansharma887@gmail.com>
resourcegrouptaggingapidoes not support ASG, hence we are using the service based approach and then merging them together for better outputs.Signed-off-by: ishuar ishansharma887@gmail.com