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

plugins:
  - ./vendor/bref/bref
  - ./vendor/bref/extra-php-extensions
# Exclude files from deployment
package:
  exclude:
    - 'node_modules/**'
    - 'tests/**'
    - '.env.local'
    - 'GPS.postman_collection.json'
    - 'bin/**'
    - 'migrations/**'
    - 'templates/**'
    - 'translations/**'
    - 'var/**'
    - '.git/**'
    - '.idea/**'
functions:
  api:
    name: 'gps-integration-service'
    environment:
      APP_ENV: 'prod'
      GIT: '4623ee7749915343291cd62ad63cafeeccbae30a'
      DATABASE_URL: '${ssm:/database/pci-dsn}/gps-integration'
      GPS_WSDL: 'gps-prod.wsdl'
      # Services URI
    handler: public/index.php
    description: 'GPS Integration Service'
    timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
    layers:
      - ${bref:layer.php-80-fpm}
      - ${bref-extra:amqp-php-80}
    events:
      - alb:
          listenerArn: '${ssm:/gps-integration-service/alb}'
          priority: 1
          multiValueHeaders: true
          conditions:
            path: /
      - schedule:
          rate: rate(5 minutes)
          input:
            warmer: true
    vpc:
      securityGroupIds:
        - '${ssm:/gps-integration-service/sg}'
      subnetIds:
        - '${ssm:/gateway-service/prod/subnet}'

