translation/v1/template.yaml [29:66]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  TranslationBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Ref TranslationBucketName

  ## Lambda functions
  TranslatorFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: translatorFunction/
      Handler: app.handler
      Runtime: nodejs12.x
      MemorySize: 128
      Environment:
        Variables:
          targetLanguage: !Ref TargetLanguage
      Policies:
        - S3CrudPolicy:
            BucketName: !Ref TranslationBucketName
        - Statement:
          - Effect: Allow
            Resource: '*'
            Action:
              - translate:*
              - comprehend:DetectDominantLanguage
              - cloudwatch:GetMetricStatistics
              - cloudwatch:ListMetrics
      Events:
        FileUpload:
          Type: S3
          Properties:
            Bucket: !Ref TranslationBucket
            Events: s3:ObjectCreated:*
            Filter: 
              S3Key:
                Rules:
                  - Name: suffix
                    Value: '.txt'            
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



videos-samples/1-translation/template-v1.yaml [19:54]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  TranslationBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Ref TranslationBucketName
  TranslatorFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: translatorFunction/
      Handler: app.handler
      Runtime: nodejs12.x
      MemorySize: 128
      Environment:
        Variables:
          targetLanguage: !Ref TargetLanguage
      Policies:
        - S3CrudPolicy:
            BucketName: !Ref TranslationBucketName
        - Statement:
          - Effect: Allow
            Resource: '*'
            Action:
              - translate:*
              - comprehend:DetectDominantLanguage
              - cloudwatch:GetMetricStatistics
              - cloudwatch:ListMetrics
      Events:
        FileUpload:
          Type: S3
          Properties:
            Bucket: !Ref TranslationBucket
            Events: s3:ObjectCreated:*
            Filter: 
              S3Key:
                Rules:
                  - Name: suffix
                    Value: '.txt'            
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



