service: three-ds-service-v2

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

plugins:
  - ./vendor/bref/bref

package:
  exclude:
    - 'node_modules/**'
    - 'tests/**'
    - '.env.local'

functions:
  api:
    name: three-ds-service-v2
    handler: public/index.php
    description: '3D Service'
    timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
    environment:
      APP_ENV: 'prod'
      DATABASE_URL: '${ssm:/3d-service-v2/prod/db_dsn}'
      GIT: '074d556879a59a68dcf2d42c5ccea119e62d85ae'
    layers:
      - ${bref:layer.php-74-fpm}
    events:
      -   alb:
            listenerArn: '${ssm:/3d-service-v2/prod/alb}'
            priority: 1
            multiValueHeaders: true
            conditions:
              path: /
      -   schedule:
            rate: rate(5 minutes)
            input:
              warmer: true
    vpc:
      securityGroupIds:
        - '${ssm:/3d-service-v2/prod/sg}'
      subnetIds:
        - '${ssm:/3d-service/prod/subnet}'
        - '${ssm:/3d-service/prod/subnet_1}'
