AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31 Description: > nodejs-example-logs-api-extension Sample SAM Template for nodejs-example-logs-api-extension Globals: Function: Timeout: 5 Resources: NodeJSExampleExtensionLayer: Type: AWS::Serverless::LayerVersion Metadata: BuildMethod: makefile Properties: LayerName: nodejs-example-logs-api-extension Description: NodeJS Logs API Example Lambda Extension Layer ContentUri: . CompatibleRuntimes: - nodejs12.x LicenseInfo: MIT-0 RetentionPolicy: Delete HelloWorldFunction: Type: AWS::Serverless::Function Properties: FunctionName: nodejs-example-logs-api-extension-demo-function CodeUri: hello-world/ Handler: app.lambdaHandler Runtime: nodejs12.x Layers: - !Ref NodeJSExampleExtensionLayer Environment: Variables: LOGS_S3_BUCKET_NAME: Ref: LogExtensionsBucket Policies: - S3WritePolicy: BucketName: !Ref LogExtensionsBucket LogExtensionsBucket: Type: 'AWS::S3::Bucket' Properties: LifecycleConfiguration: Rules: - Id: DeleteAfterSevenDays Status: "Enabled" ExpirationInDays: 7 Outputs: NodeJSExampleExtensionLayer: Description: NodeJS Logs Example Lambda Extension Layer Version ARN Value: !Ref NodeJSExampleExtensionLayer HelloWorldFunction: Description: First Lambda Function ARN Value: !GetAtt HelloWorldFunction.Arn HelloWorldFunctionIamRole: Description: Implicit IAM Role created for Hello World function Value: !GetAtt HelloWorldFunctionRole.Arn