Skip to content

Instantly share code, notes, and snippets.

@deeheber
Created May 10, 2019 21:13
Show Gist options
  • Save deeheber/fdfd05ad3fc5be519058c611aaacbbfa to your computer and use it in GitHub Desktop.
Save deeheber/fdfd05ad3fc5be519058c611aaacbbfa to your computer and use it in GitHub Desktop.
GetFile Function YAML
GetFile:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub ${AWS::StackName}-GetFile
Description: !Sub
- Stack ${StackTagName} Environment ${EnvironmentTagName} Function ${ResourceName}
- ResourceName: GetFile
CodeUri: src/GetFile
Handler: index.handler
Runtime: nodejs8.10
MemorySize: 3008
Timeout: 30
Tracing: Active
Policies:
- AWSXrayWriteOnlyAccess
- Version: 2012-10-17
Statement:
- Effect: Allow
Resource: !GetAtt Table.Arn
Action:
- dynamodb:GetItem
- dynamodb:Scan
Events:
ApiGETfile:
Type: Api
Properties:
Path: /file
Method: GET
RestApiId: !Ref Api
Environment:
Variables:
TABLE_NAME: !Ref Table
TABLE_ARN: !GetAtt Table.Arn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment