Skip to content

Commit 2c1a8bd

Browse files
committed
Zappa
1 parent 5c78dd6 commit 2c1a8bd

File tree

6 files changed

+488
-0
lines changed

6 files changed

+488
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Tracing with X-Ray
2+
3+
## Create SSM Parameter
4+
5+
```sh
6+
aws ssm put-parameter --type String --name "/dev/example/table_name" --value "Flask"
7+
```
8+
9+
## Create DynamoDB Table
10+
11+
Create table `Flask` with primary partition key `key`:
12+
13+
```sh
14+
aws dynamodb create-table --table-name Flask \
15+
--attribute-definitions AttributeName=key,AttributeType=S \
16+
--key-schema AttributeName=key,KeyType=HASH \
17+
--billing-mode=PAY_PER_REQUEST
18+
```
19+
20+
## Configure Zappa
21+
22+
```sh
23+
pipenv --python 3.7
24+
pipenv shell
25+
pipenv install aws-xray-sdk flask zappa requests
26+
pipenv lock -r > requirements.txt
27+
zappa init
28+
zappa deploy
29+
```
30+
31+
## Enable X-Ray Tracing for API Gateway
32+
33+
In this step you will interact with the API Gateway console to enable X\-Ray tracing\.
34+
35+
1. Sign in to the AWS Management Console and open the API Gateway console at <https://console\.aws\.amazon\.com/apigateway/>.
36+
1. Select your API, i.e. `example-dev`.
37+
1. Choose **Stages**.
38+
1. Choose the name of your deployment stage, i.e. `dev`.
39+
1. On the **Logs/Tracing** tab, select the **Enable X-Ray Tracing** box.
40+
1. Choose **Save Changes**.
41+
1. Access the endpoint in your browser.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
8+
[packages]
9+
aws-xray-sdk = "*"
10+
flask = "*"
11+
zappa = "*"
12+
requests = "*"
13+
14+
[requires]
15+
python_version = "3.7"

Monitoring-Debugging/Tracing-with-X-Ray/example/Pipfile.lock

Lines changed: 322 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)