This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if you gonna have more then 500 api gateways, then you gonna need to wrap this into the loop and after first 500 you gonna need to pass position parameter to get_rest_apis method | |
import boto3 | |
client = boto3.client('apigateway') | |
response = client.get_rest_apis( | |
limit=500 | |
) | |
print(f"We have {len(response['items'])} api gateways to process") | |
for apigateway in response['items']: | |
print(f"Enabling {apigateway['name']} api gateway tracing") | |
client.update_stage( | |
restApiId=apigateway['id'], | |
stageName='{your-stage-name}', | |
patchOperations=[ | |
{ | |
'op': 'replace', | |
'path': '/tracingEnabled', | |
'value': 'True' | |
} | |
] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment