AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: > Sample SAM Template for {{ cookiecutter.project_name }} Parameters: AppBucketName: Type: String Description: "REQUIRED: Unique S3 bucket name to use for the app." # More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst Globals: Function: Timeout: 10 MemorySize: 128 Resources: S3JsonLoggerFunction: # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction Type: AWS::Serverless::Function Properties: CodeUri: ./src/{{cookiecutter.project_name}}/ Handler: {{cookiecutter.project_name}}::{{cookiecutter.project_name}}.Function::FunctionHandler Runtime: dotnet6 MemorySize: 256 Policies: S3ReadPolicy: BucketName: !Ref AppBucketName Events: S3NewObjectEvent: Type: S3 Properties: Bucket: !Ref AppBucket Events: s3:ObjectCreated:* Filter: S3Key: Rules: - Name: suffix Value: ".json" AppBucket: Type: AWS::S3::Bucket Properties: BucketName: !Ref AppBucketName Outputs: AppBucketArn: Description: "S3 Bucket" Value: !Ref AppBucket