Skip to content

Commit 5e4065b

Browse files
authored
Merge pull request #137 from sot528/ALIS-842
Alis 842
2 parents a514e8d + 656441c commit 5e4065b

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.envrc.sample

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
## すべてのサブシステムで同じ値を使う必要がある
55
export ALIS_APP_ID=foobar
66

7+
# CloudFormationで生成されたAPI GatewayのAPI ID
8+
# スクリプトから各APIに事後処理を行うために使用する
9+
# 現状、SAMがIAM認証をサポートしていないため
10+
# TODO: SAMがIAM認証をサポートしたらteplate.yamlに集約してこの値とスクリプトを除却する
11+
# - see: https://github.com/awslabs/serverless-application-model/issues/248
12+
export SERVERLESS_REST_API_ID=pe6odilrre
13+
714
# --- AWS ---
815

916
## aws-cli

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,12 @@ Specify generated Cognito User Pool ARN to SSM.
9797
./deploy.sh api
9898
python elasticsearch-setup.py YourGlobalIP
9999
```
100+
101+
### Fix API settings via a script
102+
103+
```bash
104+
# Set SERVERLESS_REST_API_ID to .envrc
105+
direnv edit
106+
107+
./fix_api.sh
108+
```

fix_api.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
# Delete unnecessary Stage "Stage"
4+
# SAM's bug? https://github.com/awslabs/serverless-application-model/issues/168
5+
aws apigateway delete-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name Stage
6+
7+
# ---
8+
9+
# Enable logs
10+
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name 'api' --patch-operations op=replace,path=/*/*/logging/dataTrace,value=true
11+
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name 'api' --patch-operations op=replace,path=/*/*/logging/loglevel,value=INFO
12+
aws apigateway update-stage --rest-api-id ${SERVERLESS_REST_API_ID} --stage-name 'api' --patch-operations op=replace,path=/*/*/metrics/enabled,value=true

0 commit comments

Comments
 (0)