ImageProcessing/workshop/static/cloudformation/legacy_templates/setup-sam-ap-northeast-1.yaml [196:288]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Description: Save metadata of the photo to DynamoDB table
      Environment:
        Variables:
          RIDER_PHOTOS_DDB_TABLE:
            Ref: RiderPhotoDDBTable
      Handler: index.handler
      MemorySize: 256
      Policies:
        Statement:
        - Action:
          - dynamodb:PutItem
          Effect: Allow
          Resource:
            Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${RiderPhotoDDBTable}
          Sid: WriteToRiderPhotoDDBTable
      Runtime: nodejs8.10
      Timeout: 60
    Type: AWS::Serverless::Function
  PopulateTestImages:
    Properties:
      Bucket:
        Ref: RiderPhotoS3Bucket
      ServiceToken:
        Fn::GetAtt:
        - CopyS3ObjectsFunction
        - Arn
      SourceBucket:
        Ref: TestImagesBucket
      SourcePrefix:
        Fn::Sub: ${TestImagesPrefix}
    Type: Custom::S3Objects
  RiderPhotoDDBTable:
    Properties:
      AttributeDefinitions:
      - AttributeName: Username
        AttributeType: S
      KeySchema:
      - AttributeName: Username
        KeyType: HASH
      ProvisionedThroughput:
        ReadCapacityUnits: '3'
        WriteCapacityUnits: '3'
    Type: AWS::DynamoDB::Table
  RiderPhotoS3Bucket:
    Properties:
      CorsConfiguration:
        CorsRules:
        - AllowedHeaders:
          - '*'
          AllowedMethods:
          - PUT
          - GET
          - POST
          - HEAD
          AllowedOrigins:
          - '*'
          ExposedHeaders:
          - ETag
    Type: AWS::S3::Bucket
  StateMachineRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
        - Action:
          - sts:AssumeRole
          Effect: Allow
          Principal:
            Service:
              Fn::Sub: states.${AWS::Region}.amazonaws.com
        Version: '2012-10-17'
      Path: /WildRydes/
      Policies:
      - PolicyDocument:
          Statement:
          - Action:
            - lambda:InvokeFunction
            Effect: Allow
            Resource: '*'
            Sid: InvokeLambda
          Version: '2012-10-17'
        PolicyName: InvokeLambda
      - PolicyDocument:
          Statement:
          - Action:
            - SNS:Publish
            Effect: Allow
            Resource: '*'
            Sid: PublishToSNS
          Version: '2012-10-17'
        PolicyName: PublishToSNS
    Type: AWS::IAM::Role
  ThumbnailFunction:
    Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



ImageProcessing/workshop/static/cloudformation/legacy_templates/setup-sam-ap-northeast-2.yaml [196:288]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      Description: Save metadata of the photo to DynamoDB table
      Environment:
        Variables:
          RIDER_PHOTOS_DDB_TABLE:
            Ref: RiderPhotoDDBTable
      Handler: index.handler
      MemorySize: 256
      Policies:
        Statement:
        - Action:
          - dynamodb:PutItem
          Effect: Allow
          Resource:
            Fn::Sub: arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${RiderPhotoDDBTable}
          Sid: WriteToRiderPhotoDDBTable
      Runtime: nodejs8.10
      Timeout: 60
    Type: AWS::Serverless::Function
  PopulateTestImages:
    Properties:
      Bucket:
        Ref: RiderPhotoS3Bucket
      ServiceToken:
        Fn::GetAtt:
        - CopyS3ObjectsFunction
        - Arn
      SourceBucket:
        Ref: TestImagesBucket
      SourcePrefix:
        Fn::Sub: ${TestImagesPrefix}
    Type: Custom::S3Objects
  RiderPhotoDDBTable:
    Properties:
      AttributeDefinitions:
      - AttributeName: Username
        AttributeType: S
      KeySchema:
      - AttributeName: Username
        KeyType: HASH
      ProvisionedThroughput:
        ReadCapacityUnits: '3'
        WriteCapacityUnits: '3'
    Type: AWS::DynamoDB::Table
  RiderPhotoS3Bucket:
    Properties:
      CorsConfiguration:
        CorsRules:
        - AllowedHeaders:
          - '*'
          AllowedMethods:
          - PUT
          - GET
          - POST
          - HEAD
          AllowedOrigins:
          - '*'
          ExposedHeaders:
          - ETag
    Type: AWS::S3::Bucket
  StateMachineRole:
    Properties:
      AssumeRolePolicyDocument:
        Statement:
        - Action:
          - sts:AssumeRole
          Effect: Allow
          Principal:
            Service:
              Fn::Sub: states.${AWS::Region}.amazonaws.com
        Version: '2012-10-17'
      Path: /WildRydes/
      Policies:
      - PolicyDocument:
          Statement:
          - Action:
            - lambda:InvokeFunction
            Effect: Allow
            Resource: '*'
            Sid: InvokeLambda
          Version: '2012-10-17'
        PolicyName: InvokeLambda
      - PolicyDocument:
          Statement:
          - Action:
            - SNS:Publish
            Effect: Allow
            Resource: '*'
            Sid: PublishToSNS
          Version: '2012-10-17'
        PolicyName: PublishToSNS
    Type: AWS::IAM::Role
  ThumbnailFunction:
    Properties:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



