Skip to content

Instantly share code, notes, and snippets.

@thanakijwanavit
Created May 12, 2020 09:50
Show Gist options
  • Save thanakijwanavit/786259e2ff3413d3da1fea71882b6ba7 to your computer and use it in GitHub Desktop.
Save thanakijwanavit/786259e2ff3413d3da1fea71882b6ba7 to your computer and use it in GitHub Desktop.
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
inventory functions
Metadata:
AWS::ServerlessRepo::Application:
Name: inv-app
Description: for managing inventory
Author: nicWanavit
SpdxLicenseId: Apache-2.0
LicenseUrl: LICENSE.txt
ReadmeUrl: README.md
Labels: ['tests']
HomePageUrl: https://github.com/thanakijwanavit/villaMaster/tree/master/villa-master-dev/inv
SemanticVersion: 0.0.9
SourceCodeUrl: https://github.com/thanakijwanavit/villaMaster/tree/master/villa-master-dev/inv
Globals:
Function:
Timeout: 30
Environment:
Variables:
MY_ACCESS_KEY_ID:
MY_SECRET_ACCESS_KEY:
Resources:
GetInvFunction:
Type: AWS::Serverless::Function
Properties:
Layers:
- arn:aws:lambda:ap-southeast-1:770693421928:layer:Klayers-python38-pandas:8
FunctionName: inv-get
CodeUri: get_inv/
Handler: app.lambda_handler
Runtime: python3.8
Environment:
Variables:
MY_ACCESS_KEY_ID:
MY_SECRET_ACCESS_KEY:
SetInvFunction:
Type: AWS::Serverless::Function
Properties:
Layers:
- arn:aws:lambda:ap-southeast-1:770693421928:layer:Klayers-python38-pandas:8
FunctionName: inv-set
CodeUri: set_inv/
Handler: app.lambda_handler
Runtime: python3.8
AddInvFunction:
Type: AWS::Serverless::Function
Properties:
Layers:
- arn:aws:lambda:ap-southeast-1:770693421928:layer:Klayers-python38-pandas:8
FunctionName: inv-add
CodeUri: add_inv/
Handler: app.lambda_handler
Runtime: python3.8
InventoryTableProd:
Type: AWS::DynamoDB::Table
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: "brcode"
AttributeType: "S"
KeySchema:
- AttributeName: "brcode"
KeyType: "HASH"
TableName: "productInventory-prod"
Outputs:
GetInvFunction:
Description: "get inventory"
Value: !GetAtt GetInvFunction.Arn
HelloWorldFunctionIamRole:
Description: "Implicit IAM Role created for Hello World function"
Value: !GetAtt GetInvFunctionRole.Arn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment