$schema: 'https://raw.githubusercontent.com/guardian/riff-raff/master/contrib/riff-raff-yaml-schema.json'
stacks: [newsletters]
regions: [eu-west-1]
allowedStages: [CODE, PROD]
templates:
  cloudformation-template:
    type: cloud-formation
    parameters:
      cloudFormationStackByTags: false
      prependStackToCloudFormationStackName: false
  autoscaling-template:
    type: autoscaling
    parameters:
      bucketSsmLookup: true
deployments:
  # Newsletters internal tool cloudformation deployment
  newsletters-tool-cfn:
    template: cloudformation-template
    app: newsletters-tool
    parameters:
      cloudFormationStackName: newsletters-tool
      amiParametersToTags:
        AMINewsletterstool:
          BuiltBy: amigo
          Recipe: newsletters-node
        AMINewslettersapi:
          BuiltBy: amigo
          Recipe: newsletters-node
      templateStagePaths:
        CODE: NewslettersTool-CODE.template.json
        PROD: NewslettersTool-PROD.template.json

  # Newsletters internal tool autoscaling deployment
  newsletters-tool:
    template: autoscaling-template
    dependencies: [newsletters-tool-cfn]

  newsletters-api:
    template: autoscaling-template
    dependencies: [newsletters-tool-cfn]
