AWSTemplateFormatVersion : '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: A SAM template for deploying the DynamicFileTranslation Lambda function. Globals: Function: Timeout: 15 Resources: DynamicFileTranslation: Type: AWS::Serverless::Function Properties: Description: Translate files from a source to a target language using Amazon Translate and S3 Object Lambda FunctionName: DynamicFileTranslation Handler: DynamicFileTranslation.lambda_handler Runtime: python3.8 PackageType: Zip # Grants this function permission to call S3 and Amazon Translate Policies: - Version: "2012-10-17" Statement: - Effect: "Allow" Action: - "s3:GetObject" - "s3-object-lambda:WriteGetObjectResponse" Resource: - "*" # For additional security, you should scope down S3 resource by replacing values within the <> # - "”, # - "" - Effect: "Allow" Action: - "translate:TranslateText" Resource: '*'