service: three-d-service-test

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

plugins:
  - ./vendor/bref/bref

package:
  exclude:
    - 'node_modules/**'
    - 'tests/**'

functions:
  api:
    name: three-d-service-test
    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/prod/db_dsn}'
      THREEDS_SECURE: '${ssm:/3d-service/prod/3ds_secure_url}'
      THREEDS_SECURE_V2: '${ssm:/3d-service/prod/3ds_secure_v2_url}'
    layers:
      - ${bref:layer.php-74-fpm}
    events:
      -   alb:
            listenerArn: 'arn:aws:elasticloadbalancing:eu-central-1:929138033643:listener/app/3d-service-v2-lambda-elb/9e0c2e4a4f8d89a1/b037b2e350bd58f9'
            priority: 1
            multiValueHeaders: true
            conditions:
              path: /
      -   schedule:
            rate: rate(5 minutes)
            input:
              warmer: true
    vpc:
      securityGroupIds:
        - '${ssm:/3d-service/prod/sg}'
      subnetIds:
        - '${ssm:/3d-service/prod/subnet}'
        - '${ssm:/3d-service/prod/subnet_1}'
console:
  api:
    name: three-d-service-test
    handler: bin/console
    description: '3D Service'
    timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
    environment:
      APP_ENV: 'prod'
      DATABASE_URL: '${ssm:/3d-service/prod/db_dsn}'
    layers:
      - ${bref:layer.php-74-fpm}
      - ${bref:layer.console}
    vpc:
      securityGroupIds:
        - '${ssm:/3d-service/prod/sg}'
      subnetIds:
        - '${ssm:/3d-service/prod/subnet}'
        - '${ssm:/3d-service/prod/subnet_1}'
