stacks:
- frontend
regions:
- eu-west-1
allowedStages:
  - CODE
  - PROD
templates:
  frontend:
    type: autoscaling
    parameters:
      bucketSsmKey: /account/services/dotcom-artifact.bucket
      warmupGrace: 60
    dependencies:
    - frontend-static
    - update-ami-for-legacy-stacks
    - update-ami-for-admin
    - update-ami-for-discussion
    - update-ami-for-sport

deployments:
  admin:
    template: frontend
  applications:
    template: frontend
  archive:
    template: frontend
  article:
    template: frontend
  commercial:
    template: frontend
  discussion:
    template: frontend
  facia:
    template: frontend
  facia-press:
    template: frontend
  identity:
    template: frontend
  onward:
    template: frontend
  preview:
    template: frontend
  rss:
    template: frontend
  sport:
    template: frontend
  frontend-static:
    type: aws-s3
    parameters:
      bucketSsmKey: /account/services/dotcom-static.bucket
      cacheControl: public, max-age=315360000, immutable
      prefixStack: false
      publicReadAcl: false
  update-ami-for-legacy-stacks:
    type: ami-cloudformation-parameter
    parameters:
      cloudFormationStackByTags: false
      prependStackToCloudFormationStackName: false
      cloudFormationStackName: frontend
      amiParametersToTags:
        AMI:
          Recipe: ubuntu-jammy-frontend-base-ARM-java11-cdk-base
          AmigoStage: PROD
  # Riff-Raff identifies the GuCDK stacks using tag-based lookups
  update-ami-for-admin:
    app: admin
    type: ami-cloudformation-parameter
    parameters:
      amiParametersToTags:
        AMIAdmin:
          Recipe: ubuntu-jammy-frontend-base-ARM-java11-cdk-base
          AmigoStage: PROD
  update-ami-for-discussion:
    app: discussion
    type: ami-cloudformation-parameter
    parameters:
      amiParametersToTags:
        AMIDiscussion:
          Recipe: ubuntu-jammy-frontend-base-ARM-java11-cdk-base
          AmigoStage: PROD
  update-ami-for-sport:
    app: sport
    type: ami-cloudformation-parameter
    parameters:
      amiParametersToTags:
        AMISport:
          Recipe: ubuntu-jammy-frontend-base-ARM-java11-cdk-base
          AmigoStage: PROD
