-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cca8820
commit cba23b3
Showing
6 changed files
with
199 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/dynamodb-local | ||
dynamodb_local_latest.tar.gz* | ||
Makefile | ||
.aws-sam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# NB! We are only using SAM to run the application as a Lambda function behind | ||
# the API Gateway locally. We are actually using Terraform to describe and deploy | ||
# the infrastructure (see `infra` directory in the project's root with IaC files). | ||
|
||
# More information about the configuration file can be found here: | ||
# https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html | ||
version = 0.1 | ||
stack_name = "wewerewondering" | ||
|
||
[default.build.parameters] | ||
# Cargo Lambda is supported as a beta feature in SAM: | ||
# https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/building-rust.html | ||
beta_features = true | ||
cached = true | ||
parallel = true | ||
|
||
[default.validate.parameters] | ||
lint = true | ||
|
||
[default.deploy.parameters] | ||
capabilities = "CAPABILITY_IAM" | ||
confirm_changeset = true | ||
resolve_s3 = true | ||
|
||
[default.package.parameters] | ||
resolve_s3 = true | ||
|
||
[default.sync.parameters] | ||
beta_features = true | ||
watch = true | ||
|
||
[default.local_start_api.parameters] | ||
warm_containers = "EAGER" | ||
# The command `sam local start-api` will be launch Lambda Runtime in a docker | ||
# container and so we need to make sure the DynamoDB Local is in the same network | ||
# (see `DYNAMODB_NETWORK_NAME` in `./run-dynamodb-local.sh`) | ||
docker_network = "wewerewondering" | ||
|
||
[default.local_start_lambda.parameters] | ||
warm_containers = "EAGER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# NB! We are only using SAM to run the application as a Lambda function behind | ||
# the API Gateway locally. We are actually using Terraform to describe and deploy | ||
# the infrastructure (see `infra` directory in the project's root with IaC files, | ||
# specifically `infra/apigw.tf` and `infra/lambda.tf`). | ||
|
||
AWSTemplateFormatVersion: '2010-09-09' | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: Sample SAM Template for running and tesing WeWereWondering locally | ||
Resources: | ||
WeWereWonderingApi: | ||
Type: AWS::Serverless::Function | ||
Metadata: | ||
BuildMethod: rust-cargolambda | ||
Properties: | ||
CodeUri: . | ||
Handler: bootstrap | ||
Runtime: provided.al2 | ||
Architectures: | ||
- x86_64 | ||
Timeout: 29 | ||
MemorySize: 512 | ||
Events: | ||
FetchEvent: | ||
Type: HttpApi | ||
Properties: | ||
Path: /api/event/{eid} | ||
Method: get | ||
CreateEvent: | ||
Type: HttpApi | ||
Properties: | ||
Path: /api/event | ||
Method: post | ||
AskQuestion: | ||
Type: HttpApi | ||
Properties: | ||
Path: /api/event/{eid} | ||
Method: post | ||
FetchAllUnhiddenQuestionsForEvent: | ||
Type: HttpApi | ||
Properties: | ||
Path: /api/event/{eid}/questions | ||
Method: get | ||
FetchFetchAllQuestionsForEventAllQuestionsForEvent: | ||
Type: HttpApi | ||
Properties: | ||
Path: /api/event/{eid}/questions/{secret} | ||
Method: get | ||
ToggleQuestionProperty: | ||
Type: HttpApi | ||
Properties: | ||
Path: /api/event/{eid}/questions/{secret}/{qid}/toggle/{property} | ||
Method: post | ||
UpvoteDownvoteQuestion: | ||
Type: HttpApi | ||
Properties: | ||
Path: /api/vote/{qid}/{updown} | ||
Method: post | ||
FetchQuestions: | ||
Type: HttpApi | ||
Properties: | ||
Path: /api/questions/{qids} | ||
Method: get | ||
Environment: | ||
Variables: | ||
RUST_LOG: debug | ||
USE_DYNAMODB: local | ||
AWS_ENDPOINT_URL: http://dynamodb-local:8000 |