-
Notifications
You must be signed in to change notification settings - Fork 17
/
fix_api.sh
executable file
·16 lines (13 loc) · 1.29 KB
/
fix_api.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
# Delete unnecessary Stage "Stage"
# SAM's bug? https://github.com/awslabs/serverless-application-model/issues/168
aws apigateway delete-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name Stage
aws apigateway delete-stage --rest-api-id ${SERVERLESS_REST_API_WITH_OAUTH_ID} --stage-name Stage
# ---
# Enable logs
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name 'api' --patch-operations op=replace,path=/*/*/logging/dataTrace,value=true
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name 'api' --patch-operations op=replace,path=/*/*/logging/loglevel,value=INFO
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name 'api' --patch-operations op=replace,path=/*/*/metrics/enabled,value=true
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_WITH_OAUTH_ID} --stage-name 'oauth2api' --patch-operations op=replace,path=/*/*/logging/dataTrace,value=true
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_WITH_OAUTH_ID} --stage-name 'oauth2api' --patch-operations op=replace,path=/*/*/logging/loglevel,value=INFO
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_WITH_OAUTH_ID} --stage-name 'oauth2api' --patch-operations op=replace,path=/*/*/metrics/enabled,value=true