service: theear-resources
useDotenv: true
package:
  individually: true

frameworkVersion: ">=1.1.0"

plugins:
  - serverless-bundle
  - serverless-offline
  - serverless-dotenv-plugin

custom:
  bucket: the-ear-resources

provider:
  name: aws
  runtime: nodejs12.x
  stage: dev
  region: eu-west-1
  profile: unity
  memorySize: 512
  iamRoleStatements:
    - Effect: Allow
      Action:
        - s3:*
      Resource: "*"
  environment:
    tableName: loging
    databaseHost: ${env:DBHOST}
    databaseUser: ${env:DBUSERNAME}
    databasePass: ${env:DBPASSWORD}
    databaseName: ${env:DBNAME}
functions:
  transcode:
    handler: transcode.main
    timeout: 60
    events:
      - s3:
          bucket: ${self:custom.bucket}
          event: s3:ObjectCreated:*
          existing: true
