Skip to content

fix: handle disabled-region timeouts and Python 3.12 import compatibility#144

Open
hsagnik wants to merge 1 commit into
nccgroup:masterfrom
hsagnik:fix/region-timeout-and-py312-compat
Open

fix: handle disabled-region timeouts and Python 3.12 import compatibility#144
hsagnik wants to merge 1 commit into
nccgroup:masterfrom
hsagnik:fix/region-timeout-and-py312-compat

Conversation

@hsagnik
Copy link
Copy Markdown

@hsagnik hsagnik commented May 7, 2026

Summary

  • Add `connect_timeout=10` and `retries={'max_attempts': 0}` via botocore `Config` to all regional AWS clients (autoscaling, cloudformation, codebuild, kms, sns, sqs, secretsmanager, lambda) so calls to disabled/unreachable regions fail fast instead of hanging indefinitely
  • Catch `ConnectTimeoutError` and `EndpointConnectionError` alongside `ClientError` in all per-region exception handlers so disabled-region errors are logged and skipped gracefully
  • Fix `case_insensitive_dict.py` to import `Mapping`/`MutableMapping` from `collections.abc` instead of `collections`, which was removed in Python 3.12
  • Fix misleading log message in `lambda_edges.py`: "stacks" → "functions"

Test plan

  • Run PMapper against an AWS account that has disabled regions and verify it completes without hanging
  • Run PMapper under Python 3.12 and verify no `ImportError` on `case_insensitive_dict`
  • Confirm per-region warning logs appear correctly when a region is unreachable

…lity

- Add connect_timeout=10 and retries={'max_attempts': 0} via botocore Config
  to all regional AWS clients (autoscaling, cloudformation, codebuild, kms,
  sns, sqs, secretsmanager, lambda) so calls to disabled/unreachable regions
  fail fast instead of hanging indefinitely
- Catch ConnectTimeoutError and EndpointConnectionError alongside ClientError
  in all per-region exception handlers so disabled-region errors are logged
  and skipped gracefully
- Fix case_insensitive_dict.py to import Mapping/MutableMapping from
  collections.abc instead of collections, which was removed in Python 3.12
- Fix lambda_edges.py warning message: "stacks" → "functions"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant