regions:
  - eu-west-1
stacks:
  - workflow
allowedStages:
  - CODE
  - PROD
deployments:
  pinboard-db-jump-host-asg-artifact:
    type: autoscaling
    actions:
      - uploadArtifacts # we don't need the 'deploy' action, as ASG is programmatically scaled up from 0, ephemerally
    app: pinboard
    parameters:
      bucketSsmLookup: true
      prefixApp: true

  pinboard-cloudformation:
    dependencies:
      - pinboard-db-jump-host-asg-artifact
    type: cloud-formation
    app: pinboard
    parameters:
      cloudFormationStackByTags: false
      prependStackToCloudFormationStackName: false
      cloudFormationStackName: pinboard
      templateStagePaths:
        CODE: PinBoardStack-CODE.template.json
        PROD: PinBoardStack-PROD.template.json
      amiTags:
        Recipe: editorial-tools-focal-java8-ARM-WITH-cdk-base
        AmigoStage: PROD
      amiEncrypted: true
      amiParameter: AMIPinboard

  pinboard-bootstrapping-lambda-api:
    dependencies:
      - pinboard-cloudformation
      - pinboard-workflow-bridge-lambda
      - pinboard-grid-bridge-lambda
      - pinboard-users-refresher-lambda
      - pinboard-notifications-lambda
      - pinboard-auth-lambda
      - pinboard-database-bridge-lambda
    type: aws-lambda
    parameters:
      prefixStack: false
      fileName: pinboard-bootstrapping-lambda-api.zip
      functionNames: [pinboard-bootstrapping-lambda-]

  pinboard-workflow-bridge-lambda:
    dependencies:
      - pinboard-cloudformation
    type: aws-lambda
    parameters:
      prefixStack: false
      fileName: pinboard-workflow-bridge-lambda.zip
      functionNames: [pinboard-workflow-bridge-lambda-]

  pinboard-grid-bridge-lambda:
    dependencies:
      - pinboard-cloudformation
    type: aws-lambda
    parameters:
      prefixStack: false
      fileName: pinboard-grid-bridge-lambda.zip
      functionNames: [pinboard-grid-bridge-lambda-]

  pinboard-users-refresher-lambda:
    dependencies:
      - pinboard-cloudformation
    type: aws-lambda
    parameters:
      prefixStack: false
      fileName: pinboard-users-refresher-lambda.zip
      functionNames: [pinboard-users-refresher-lambda-]

  pinboard-notifications-lambda:
    dependencies:
      - pinboard-cloudformation
    type: aws-lambda
    parameters:
      prefixStack: false
      fileName: pinboard-notifications-lambda.zip
      functionNames: [pinboard-notifications-lambda-]

  pinboard-auth-lambda:
    dependencies:
      - pinboard-cloudformation
    type: aws-lambda
    parameters:
      prefixStack: false
      fileName: pinboard-auth-lambda.zip
      functionNames: [pinboard-auth-lambda-]

  pinboard-database-bridge-lambda:
    dependencies:
      - pinboard-cloudformation
    type: aws-lambda
    parameters:
      prefixStack: false
      fileName: pinboard-database-bridge-lambda.zip
      functionNames: [pinboard-database-bridge-lambda-]

  pinboard-archiver-lambda:
    dependencies:
      - pinboard-cloudformation
    type: aws-lambda
    app: pinboard
    parameters:
      prefixStack: false
      fileName: pinboard-archiver-lambda.zip
      functionNames: [pinboard-archiver-lambda-]

  pinboard-email-lambda:
    dependencies:
      - pinboard-cloudformation
    type: aws-lambda
    app: pinboard
    parameters:
      prefixStack: false
      fileName: pinboard-email-lambda.zip
      functionNames: [pinboard-email-lambda-]
