Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
- I broke error handling in my last commit when targeting multiple regions -- this fixes that
  • Loading branch information
TeneBrae93 authored Jun 4, 2024
1 parent d216902 commit e00f5ee
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions pacu/modules/apigateway__enum/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,24 @@ def main(args, pacu_main: "Main"):
client = pacu_main.get_boto3_client('apigateway', region)
print(f"Enumerating {region}")

summary_data['apiKeys'] = get_api_keys(client)
summary_data['clientCerts'] = get_client_certs(client)
# Get global API data
try:
summary_data['apiKeys'] = get_api_keys(client)
except Exception as e:
print(f"Failed to get API Keys in {region}: {e}")
try:
summary_data['clientCerts'] = get_client_certs(client)
except Exception as e:
print(f"Failed to get Client Certs in {region}: {e}")

# Currently this only supports REST apis
# Get all apis in AWS Gatway
try:
response = client.get_rest_apis()
except Exception as e:
print(f"Failed to get APIs in {region}: {e}")
continue

response = client.get_rest_apis()
items = response['items']

for api in items:
Expand Down

0 comments on commit e00f5ee

Please sign in to comment.