Skip to content

Instantly share code, notes, and snippets.

@thanakijwanavit
Last active December 19, 2020 16:26
Show Gist options
  • Save thanakijwanavit/ea9c458b832c33d66566c308480a5750 to your computer and use it in GitHub Desktop.
Save thanakijwanavit/ea9c458b832c33d66566c308480a5750 to your computer and use it in GitHub Desktop.
efs template for demo
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
shortenLink
Sample SAM Template for shortenLink
Globals:
Function:
Timeout: 3
Runtime: python3.8
MemorySize: 128
VpcConfig:
SecurityGroupIds: !Ref SecurityGroupIds
SubnetIds: !Ref SubnetIDs
FileSystemConfigs:
- Arn: !Ref AccessPointARN
LocalMountPath: !Ref EFSpath
Parameters:
SecurityGroupIds:
Type: CommaDelimitedList
Default: sg-73dae500
SubnetIDs:
Type: CommaDelimitedList
Description: The list of SubnetIDs in your Virtual Private Cloud (VPC)
Default: subnet-0ca9ad2cd96fccccc
EFSpath:
Type: String
Default: /mnt/efs
AccessPointARN:
Type: String
Description: Access point ARN
Default: arn:aws:elasticfilesystem:ap-southeast-1:394922924679:access-point/fsap-0c95d823fbbbb1cfc
Resources:
ShortenLinkFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: helloWorld/helloWorld/
Handler: app.lambda_handler
Events:
SampleEvent:
Type: Api
Properties:
Path: /hello
Method: post
Outputs:
Api:
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
Function:
Value: !GetAtt ShortenLinkFunction.Arn
HelloWorldFunctionIamRole:
Value: !GetAtt ShortenLinkFunctionRole.Arn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment