service: aci-gateway
provider:
  name: aws
  region: eu-central-1
  stage: prod
  runtime: provided.al2
  environment:
    APP_ENV: prod
    ECOMMERCE_SERVICE: 'https://acquiring.paynetics.net'
    THREEDS_URL: 'https://aci.paynetics.net'
    GIT: '9f928a30251d7f5c3190b386e4356f942856f28b'
    DATABASE_URL:  '${ssm:/database/pci-dsn}/aci'
plugins:
  - ./vendor/bref/bref
package:
  patterns:
    - '!public/build/**'
    - '!tests/**'
    - '!var/**'
    - '.env.local'
    - 'var/cache/prod/**'
functions:
  # This function runs the Symfony website/API
  api:
    handler: public/index.php
    timeout: 30 # in seconds (API Gateway has a timeout of 29 seconds)
    layers:
      - ${bref:layer.php-81-fpm}
    events:
      - alb:
          listenerArn: '${ssm:/aci-gateway/prod/alb}'
          priority: 1
          multiValueHeaders: true
          conditions:
            path: /
      - schedule:
          rate: rate(5 minutes)
          input:
            warmer: true
    vpc:
      securityGroupIds:
        - '${ssm:/aci-gateway/prod/sg}'
      subnetIds:
        - '${ssm:/aci-gateway/prod/subnet_1}'
        - '${ssm:/aci-gateway/prod/subnet_2}'
