-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
167 additions
and
83 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
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
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 was deleted.
Oops, something went wrong.
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,99 @@ | ||
AWSTemplateFormatVersion : '2010-09-09' | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: A sample SAM template for deploying Hummingbird Lambda Todos function. | ||
|
||
Globals: | ||
Function: | ||
Timeout: 3 | ||
MemorySize: 256 | ||
|
||
Resources: | ||
# Todos Function | ||
hbTodosFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: Provided | ||
Runtime: provided.al2 | ||
Architectures: | ||
- arm64 | ||
CodeUri: ../.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/App/App.zip | ||
# Instructs new versions to be published to an alias named "live". | ||
AutoPublishAlias: live | ||
Events: | ||
Hello: | ||
Type: Api | ||
Properties: | ||
Path: / | ||
Method: get | ||
Create: | ||
Type: Api | ||
Properties: | ||
Path: /todos | ||
Method: post | ||
Get: | ||
Type: Api | ||
Properties: | ||
Path: /todos/{id} | ||
Method: get | ||
List: | ||
Type: Api | ||
Properties: | ||
Path: /todos/ | ||
Method: get | ||
Patch: | ||
Type: Api | ||
Properties: | ||
Path: /todos/{id} | ||
Method: path | ||
Delete: | ||
Type: Api | ||
Properties: | ||
Path: /todos/{id} | ||
Method: delete | ||
DeleteAll: | ||
Type: Api | ||
Properties: | ||
Path: /todos | ||
Method: delete | ||
Environment: | ||
Variables: | ||
TODOS_TABLE_NAME: !Ref TodosTable | ||
Policies: | ||
- DynamoDBCrudPolicy: # More info about SAM policy templates: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-policy-templates.html | ||
TableName: !Ref TodosTable | ||
|
||
TodosTable: | ||
Type: AWS::Serverless::SimpleTable # More info about SimpleTable Resource: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-simpletable.html | ||
Properties: | ||
PrimaryKey: | ||
Name: id | ||
Type: String | ||
|
||
Outputs: | ||
HelloFunctionApi: | ||
Description: "API Gateway endpoint URL for Prod stage for Hello function" | ||
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/" | ||
CreateFunctionApi: | ||
Description: "API Gateway endpoint URL for Prod stage for Create function" | ||
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/todos/" | ||
GetFunctionApi: | ||
Description: "API Gateway endpoint URL for Prod stage for Get function" | ||
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/todos/{id}" | ||
ListFunctionApi: | ||
Description: "API Gateway endpoint URL for Prod stage for List function" | ||
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/todos/" | ||
PatchFunctionApi: | ||
Description: "API Gateway endpoint URL for Prod stage for Patch function" | ||
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/todos/{id}" | ||
DeleteFunctionApi: | ||
Description: "API Gateway endpoint URL for Prod stage for Delete function" | ||
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/todos/{id}" | ||
DeleteAllFunctionApi: | ||
Description: "API Gateway endpoint URL for Prod stage for DeleteAll function" | ||
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/todos/" | ||
TodosFunction: | ||
Description: "Todos function name" | ||
Value: !GetAtt hbTodosFunction.Arn | ||
TodosTable: | ||
Description: "Hummingbird Todos Lambda Table" | ||
Value: !GetAtt TodosTable.Arn |
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,31 @@ | ||
# 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 | ||
|
||
[default] | ||
[default.global.parameters] | ||
stack_name = "hb-todos-lambda" | ||
|
||
[default.build.parameters] | ||
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] | ||
watch = true | ||
|
||
[default.local_start_api.parameters] | ||
warm_containers = "EAGER" | ||
|
||
[default.local_start_lambda.parameters] | ||
warm_containers = "EAGER" |