service: spiders

package:
  exclude:
    - .cache/**
    - .idea/**
    - .pytest_cache/**
    - .scrapy/**
    - .vscode/**
    - .coverage
    - tests/**
    - .pep8
    - .python-version
    - .pyup.yml
    - .travis.yml
    - LICENSE
    - README.rst
    - requirements.txt
    - test_requirements.txt
    - setup.cfg

provider:
  name: aws
  runtime: python3.7
  timeout: 30
  region: eu-central-1
  iamRoleStatements:
    - Effect: Allow
      Action:
        - cloudwatch:PutMetricData
      Resource: "*"
    - Effect: Allow
      Action:
        - s3:PutObject
      Resource: "arn:aws:s3:::${file(variables.json):S3_BUCKET}/*"
  environment:
    PG_CREDS: ${file(variables.json):PG_CREDS}

functions:
  tvinna:
    handler: handler.run
    environment:
      SCRAPY_SPIDER: tvinna
    events:
      - schedule: rate(30 minutes)
  mbl:
    handler: handler.run
    environment:
      SCRAPY_SPIDER: mbl
    events:
      - schedule: rate(30 minutes)
  alfred:
    handler: handler.run
    environment:
      SCRAPY_SPIDER: alfred
    events:
      - schedule: rate(30 minutes)

plugins:
  - serverless-python-requirements

custom:
  pythonRequirements:
    dockerizePip: true
    useDownloadCache: true
    slim: true

service: spiders

package:
  exclude:
    - .cache/**
    - .idea/**
    - .pytest_cache/**
    - .scrapy/**
    - .vscode/**
    - .coverage
    - tests/**
    - .pep8
    - .python-version
    - .pyup.yml
    - .travis.yml
    - LICENSE
    - README.rst
    - requirements.txt
    - test_requirements.txt
    - setup.cfg

provider:
  name: aws
  runtime: python3.7
  timeout: 30
  region: eu-central-1
  iamRoleStatements:
    - Effect: Allow
      Action:
        - cloudwatch:PutMetricData
      Resource: "*"
    - Effect: Allow
      Action:
        - s3:PutObject
        - s3:PutObjectAcl
      Resource: "arn:aws:s3:::${file(variables.json):S3_BUCKET}/*"
  environment:
    PG_CREDS: ${file(variables.json):PG_CREDS}

functions:
  tvinna:
    handler: handler.run
    environment:
      SCRAPY_SPIDER: tvinna
    events:
      - schedule: rate(30 minutes)
  mbl:
    handler: handler.run
    environment:
      SCRAPY_SPIDER: mbl
    events:
      - schedule: rate(30 minutes)
  alfred:
    handler: handler.run
    environment:
      SCRAPY_SPIDER: alfred
    events:
      - schedule: rate(30 minutes)

plugins:
  - serverless-python-requirements

custom:
  pythonRequirements:
    dockerizePip: true
    useDownloadCache: true
    slim: true

Add putobjectacl to the iam role
Add putobjectacl to the iam role
