AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: An AWS Serverless Specification template describing your function. Resources: invokesagemakerendpointautomlbanking: Type: 'AWS::Serverless::Function' Properties: Handler: lambda_function.lambda_handler Runtime: python3.8 CodeUri: . Description: '' MemorySize: 128 Timeout: 3 Role: >- Events: BucketEvent1: Type: S3 Properties: Bucket: Ref: Bucket1 Events: - 's3:ObjectCreated:Put' Filter: S3Key: Rules: - Name: prefix Value: inference/ - Name: suffix Value: .csv Environment: Variables: ENDPOINT_NAME: S3_BUCKET: S3_KEY: Bucket1: Type: 'AWS::S3::Bucket'