service: digitization-service
provider:
  name: aws
  region: eu-central-1
  runtime: provided.al2
  stage: prod

plugins:
  - ./vendor/bref/bref

# Exclude files from deployment
package:
  exclude:
    - 'node_modules/**'
    - 'tests/**'
    - '.env.local'
functions:
  api:
    name: 'digitization-service'
    environment:
      APP_ENV: 'prod'
      GIT: ''
      # Services URI
    handler: public/index.php
    description: 'Instance Service'
    timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
    layers:
      - ${bref:layer.php-80-fpm}
    events:
      - alb:
          listenerArn: '${ssm:/digitization-service/alb}'
          priority: 1
          multiValueHeaders: true
          conditions:
            path: /
      - schedule:
          rate: rate(5 minutes)
          input:
            warmer: true
    vpc:
      securityGroupIds:
        - '${ssm:/digitization-service/sg}'
      subnetIds:
        - '${ssm:/private-subnet-c}'
        - '${ssm:/private-subnet-d}'

