Skip to content

Commit

Permalink
Fix to cannot notify alert with AWS Lambda via API Gateway.
Browse files Browse the repository at this point in the history
  • Loading branch information
fealone committed Nov 12, 2020
1 parent b3bab23 commit cb30df4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 185 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mkdir dist \
&& cp main.py dist/ \
&& pip install -r requirements.txt -t dist/ \
&& cd dist \
&& zip ../dist.zip * \
&& zip -r ../dist.zip * \
&& cd ../ \
&& rm -rf dist
```
Expand All @@ -35,7 +35,7 @@ aws lambda create-function \
--function-name sentry-alert-to-slack-with-functions \
--runtime python3.7 \
--role {LambdaExecuteRole} \
--handler entry_point \
--handler main.entry_point \
--zip-file fileb://dist.zip \
--environment "Variables={SLACK_ENDPOINT={SLACK_WEBHOOK_ENDPOINT},PLATFORM=AWS}"
```
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@app.post("/sentry")
async def printf(request: Request) -> Dict[str, str]:
async def sentry(request: Request) -> Dict[str, str]:
body = await request.json()
payload = {"text": (f"An error occurred, for details from the issue below url."
f"\r\n{body['url']}")}
Expand Down
181 changes: 0 additions & 181 deletions poetry.lock

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = ["fealone <fealone@lonesec.com>"]
[tool.poetry.dependencies]
python = "^3.7"
fastapi = "^0.61.1"
agraffe = "0.2.0"
agraffe = "^0.3.0"
requests = "^2.24.0"

[tool.poetry.dev-dependencies]
Expand Down

0 comments on commit cb30df4

Please sign in to comment.