service: sst-analytics

provider:
  name: aws
  runtime: nodejs4.3
  stage: dev
  region: eu-central-1
  environment:
    NODE_ENV: ${env:NODE_ENV}

custom:
  schedule-dev:
    name: schedule-dev
    description: 'Triggered every hour'
    rate: rate(60 minutes)
    enabled: false

  schedule-production:
    name: schedule-production
    description: 'Triggered mondays 07:00 AM'
    rate: cron(0 7 ? * MON *)

package:
  exclude:
    - .git/**

functions:
  send:
    handler: handler.send
    description: AWS Lambda function retrieving analytics from Mailchimp and Google Analytics and sent to employees
    events:
      - schedule: ${self:custom.schedule-${opt:stage}}

service: sst-analytics

provider:
  name: aws
  runtime: nodejs4.3
  stage: dev
  region: eu-central-1
  environment:
    NODE_ENV: ${env:NODE_ENV}

custom:
  schedule-dev:
    name: schedule-dev
    description: 'Triggered every hour'
    rate: rate(60 minutes)
    enabled: false

  schedule-production:
    name: schedule-production
    description: 'Triggered mondays 07:00 AM'
    rate: cron(0 6 ? * MON *)

package:
  exclude:
    - .git/**

functions:
  send:
    handler: handler.send
    description: AWS Lambda function retrieving analytics from Mailchimp and Google Analytics and sent to employees
    events:
      - schedule: ${self:custom.schedule-${opt:stage}}

CHANGE send time in production
CHANGE send time in production

