workflows/templates/v2/template.yaml [5:86]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameters:
  ApplicationTableName:
    Type: String
    Description: Name of application's DynamoDB table
    Default: hp-application

  S3UploadBucketName:
    Type: String
    Description: The name for the S3 upload bucket.
    Default: 'happy-path-upload'

  S3DistributionBucketName:
    Type: String
    Description: The name for the S3 upload bucket.
    Default: 'happy-path-distribution'

  StreamARN:
    Type: String
    Description: The ARN for the DynamoDB table stream.
    Default: 'arn:aws:dynamodb:us-east-1:123456789012:table/hp-application/stream/2020-06-29T14:29:10.716'

  SharpLayerARN:
    Type: String
    Description: The ARN for the Sharp Lambda Layer.
    Default: 'arn:aws:lambda:us-east-1:123456789012:layer:node-sharp:3'

Globals:
  Function:
    Timeout: 5
    Runtime: nodejs12.x
    Tags:
      Application: HappyPath

Resources:
  #Lambda functions
  ResizerFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: ../../functions/resizer/
      Handler: app.handler
      MemorySize: 2056
      Layers:
        - !Ref SharpLayerARN
      Environment:
        Variables:
          OutputBucket: !Ref S3DistributionBucketName
          TableName: !Ref ApplicationTableName              
      Policies:
        - S3ReadPolicy:
            BucketName: !Ref S3UploadBucketName
        - S3CrudPolicy:
            BucketName: !Ref S3DistributionBucketName
        - DynamoDBWritePolicy:
            TableName: !Ref ApplicationTableName              

  PublishFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: ../../functions/publish/
      Handler: app.handler
      MemorySize: 128
      Layers:
        - !Ref SharpLayerARN
      Environment:
        Variables:
          TableName: !Ref ApplicationTableName              
      Policies:
        - DynamoDBWritePolicy:
            TableName: !Ref ApplicationTableName       

  ModeratorFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: ../../functions/analyze/moderator
      Handler: app.handler
      MemorySize: 128
      Timeout: 10  
      Policies:
        - S3ReadPolicy:
            BucketName: !Ref S3UploadBucketName
        - Statement:
          - Effect: Allow
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



workflows/templates/v3/template.yaml [5:86]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameters:
  ApplicationTableName:
    Type: String
    Description: Name of application's DynamoDB table
    Default: hp-application

  S3UploadBucketName:
    Type: String
    Description: The name for the S3 upload bucket.
    Default: 'happy-path-upload'

  S3DistributionBucketName:
    Type: String
    Description: The name for the S3 upload bucket.
    Default: 'happy-path-distribution'

  StreamARN:
    Type: String
    Description: The ARN for the DynamoDB table stream.
    Default: 'arn:aws:dynamodb:us-east-1:123456789012:table/hp-application/stream/2020-06-29T14:29:10.716'

  SharpLayerARN:
    Type: String
    Description: The ARN for the Sharp Lambda Layer.
    Default: 'arn:aws:lambda:us-east-1:123456789012:layer:node-sharp:3'

Globals:
  Function:
    Timeout: 5
    Runtime: nodejs12.x
    Tags:
      Application: HappyPath

Resources:
  #Lambda functions
  ResizerFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: ../../functions/resizer/
      Handler: app.handler
      MemorySize: 2056
      Layers:
        - !Ref SharpLayerARN
      Environment:
        Variables:
          OutputBucket: !Ref S3DistributionBucketName
          TableName: !Ref ApplicationTableName              
      Policies:
        - S3ReadPolicy:
            BucketName: !Ref S3UploadBucketName
        - S3CrudPolicy:
            BucketName: !Ref S3DistributionBucketName
        - DynamoDBWritePolicy:
            TableName: !Ref ApplicationTableName              

  PublishFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: ../../functions/publish/
      Handler: app.handler
      MemorySize: 128
      Layers:
        - !Ref SharpLayerARN
      Environment:
        Variables:
          TableName: !Ref ApplicationTableName              
      Policies:
        - DynamoDBWritePolicy:
            TableName: !Ref ApplicationTableName       

  ModeratorFunction:
    Type: AWS::Serverless::Function 
    Properties:
      CodeUri: ../../functions/analyze/moderator
      Handler: app.handler
      MemorySize: 128
      Timeout: 10  
      Policies:
        - S3ReadPolicy:
            BucketName: !Ref S3UploadBucketName
        - Statement:
          - Effect: Allow
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



