AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 Description: (uksb-1tsflhn7i/v1/backend)> Required resources for example chained Ground Truth jobs # NOTE: OpenCV (used by the Step1_post Lambda works well with Python 3.7, # but some dependencies are missing in later versions) Globals: Function: Runtime: python3.7 Metadata: ID: uksb-1tsflhn7i Version: 1 Stack: backend Resources: ####################### # S3 BUCKET ####################### S3SourceBucket: Type: AWS::S3::Bucket Properties: BucketName: !Sub "chained-gt-source-${AWS::AccountId}" AccessControl: "BucketOwnerFullControl" VersioningConfiguration: Status: Enabled BucketEncryption: ServerSideEncryptionConfiguration: - ServerSideEncryptionByDefault: SSEAlgorithm: 'aws:kms' CorsConfiguration: CorsRules: - AllowedHeaders: - '*' AllowedMethods: - GET AllowedOrigins: - '*' ############################################################################# # Ground Truth Custom Lambdas # (must have "SageMaker" in the name, so corresponding IAM role works) ############################################################################# SageMakerStep1PreLambda: Type: AWS::Serverless::Function Properties: CodeUri: lambda_functions/pre_step1/src Handler: main.lambda_handler SageMakerStep1PostLambda: Type: AWS::Serverless::Function Properties: CodeUri: lambda_functions/post_step1/src Handler: main.lambda_handler Timeout: 300 MemorySize: 2048 Policies: - S3CrudPolicy: BucketName: !Ref S3SourceBucket - KMSDecryptPolicy: KeyId: 'aws/s3' SageMakerStep2PreLambda: Type: AWS::Serverless::Function Properties: CodeUri: lambda_functions/pre_step2/src Handler: main.lambda_handler SageMakerStep2PostLambda: Type: AWS::Serverless::Function Properties: CodeUri: lambda_functions/post_step2/src Handler: main.lambda_handler Timeout: 300 MemorySize: 2048 Policies: - S3CrudPolicy: BucketName: !Ref S3SourceBucket - KMSDecryptPolicy: KeyId: 'aws/s3'