AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: An Amazon S3 trigger that uses Amazon Rekognition APIs to detect faces Resources: uploader: Type: AWS::Serverless::Application Properties: Location: ApplicationId: arn:aws:serverlessrepo:us-east-1:233054207705:applications/uploader SemanticVersion: 1.1.0 Parameters: # Name of the S3 Bucket to put uploaded files into (must exist prior to deployment) destBucket: !Ref Bucket1 imganalyzer: Type: AWS::Serverless::Function Properties: Handler: lambda_function.lambda_handler Runtime: python3.8 CodeUri: . Description: An Amazon S3 trigger that uses rekognition APIs to detect faces MemorySize: 128 Timeout: 3 Policies: - AmazonRekognitionReadOnlyAccess Events: BucketEvent1: Type: S3 Properties: Bucket: !Ref Bucket1 Events: - 's3:ObjectCreated:*' Bucket1: Type: 'AWS::S3::Bucket'