Skip to content

Instantly share code, notes, and snippets.

@tarasowski
Created December 1, 2023 11:53
Show Gist options
  • Save tarasowski/8a7dde78e79ef36afd493fb51aa66225 to your computer and use it in GitHub Desktop.
Save tarasowski/8a7dde78e79ef36afd493fb51aa66225 to your computer and use it in GitHub Desktop.
S3LambdaSAM
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
text-processor
Sample SAM Template for text-processor
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 3
MemorySize: 128
# You can add LoggingConfig parameters such as the Logformat, Log Group, and SystemLogLevel or ApplicationLogLevel. Learn more here https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html#sam-function-loggingconfig.
LoggingConfig:
LogFormat: JSON
Resources:
MyS3Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub 'text-processor-${AWS::AccountId}'
HelloWorldFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: hello_world/
Handler: app.lambda_handler
Runtime: python3.9
Architectures:
- x86_64
Events:
HelloWorld:
Type: S3
Properties:
Bucket: !Ref MyS3Bucket
Events: s3:ObjectCreated:*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment