Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
# 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