stacks: [mobile]
regions: [eu-west-1]

templates:
  lambda:
    type: aws-lambda
    dependencies: [mobile-purchases-cloudformation, mobile-purchases-exports-cloudformation]
    parameters:
      bucketSsmLookup: true
      prefixStack: false

deployments:
  # mobile-purchases-feast-cloudformation:
  #   type: cloud-formation
  #   parameters:
  #     templateStagePaths:
  #       CODE: MobilePurchasesFeast-CODE.template.json
  #       PROD: MobilePurchasesFeast-PROD.template.json

  mobile-purchases-cloudformation:
    type: cloud-formation
    parameters:
      templatePath: cloudformation.yaml

  mobile-purchases-dynamo-cloudformation:
    type: cloud-formation
    parameters:
      templatePath: dynamo.cloudformation.yaml
      cloudFormationStackName: mobile-purchases-dynamo
      appendStageToCloudFormationStackName: true
      cloudFormationStackByTags: false
      prependStackToCloudFormationStackName: false
    dependencies: [mobile-purchases-cloudformation]

  mobile-purchases-feast-apple-pubsub:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-feastapplepubsub-]
      fileName: feast-apple-pubsub.zip

  mobile-purchases-feast-apple-update-subscriptions:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-feast-apple-update-subscriptions-]
      fileName: feast-apple-update-subscriptions.zip

  mobile-purchases-feast-google-update-subscriptions:
    template: lambda
    parameters:
      functionNames: [ mobile-purchases-feast-google-update-subscriptions- ]
      fileName: feast-google-update-subscriptions.zip

  mobile-purchases-feast-google-pubsub:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-feastgooglepubsub-]
      fileName: feast-google-pubsub.zip

  mobile-purchases-google-pubsub:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-googlepubsub-]
      fileName: google-pubsub.zip

  mobile-purchases-apple-pubsub:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-applepubsub-]
      fileName: apple-pubsub.zip

  mobile-purchases-google-subscription-status:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-google-subscription-status-]
      fileName: google-subscription-status.zip

  mobile-purchases-apple-subscription-status:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-apple-subscription-status-]
      fileName: apple-subscription-status.zip

  mobile-purchases-apple-fetch-offer-details:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-apple-fetch-offer-details-]
      fileName: apple-fetch-offer-details.zip

  mobile-purchases-google-oauth:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-googleoauth-]
      fileName: mobile-purchases-google-oauth.jar

  mobile-purchases-google-link-user-subscription:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-google-link-user-subscription-]
      fileName: google-link-user-subscription.zip

  mobile-purchases-apple-link-user-subscription:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-apple-link-user-subscription-]
      fileName: apple-link-user-subscription.zip

  mobile-purchases-google-update-subscriptions:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-google-update-subscriptions-]
      fileName: google-update-subscriptions.zip

  mobile-purchases-user-subscriptions:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-user-subscriptions-]
      fileName: user-subscriptions.zip

  mobile-purchases-apple-update-subscriptions:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-apple-update-subscriptions-]
      fileName: apple-update-subscriptions.zip

  mobile-purchases-export-subscription-tables:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-export-subscription-table-, mobile-purchases-export-user-subscription-table-]
      fileName: export-subscription-tables.zip

  mobile-purchases-export-subscription-table-v2:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-export-subscription-table-v2-, mobile-purchases-export-user-subscription-table-v2-]
      fileName: export-subscription-table-v2.zip

  mobile-purchases-export-subscription-events-table:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-export-subscription-events-table-]
      fileName: export-subscription-events-table.zip

  mobile-purchases-delete-user-subscription:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-delete-user-subscription-]
      fileName: delete-user-subscription.zip

  mobile-purchases-soft-opt-in-acquisitions:
    template: lambda
    parameters:
      functionNames: [ mobile-purchases-soft-opt-in-acquisitions- ]
      fileName: soft-opt-in-acquisitions.zip

  mobile-purchases-soft-opt-in-acquisitions-dlq-processor:
    template: lambda
    parameters:
      functionNames: [ mobile-purchases-soft-opt-in-acquisitions-dlq-processor- ]
      fileName: soft-opt-in-acquisitions-dlq-processor.zip

  mobile-purchases-exports-cloudformation:
    type: cloud-formation
    parameters:
      templatePath: exports-cloudformation.yaml

  mobile-purchases-export-historical-data:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-export-google-historical-data-, mobile-purchases-export-apple-historical-data-]
      fileName: export-historical-data.zip

  mobile-purchases-apple-revalidate-receipts:
    template: lambda
    parameters:
      functionNames: [mobile-purchases-apple-revalidate-receipts-]
      fileName: apple-revalidate-receipts.zip

  mobile-purchases-feast-acquisition-events-bus-cloudformation:
    type: cloud-formation
    parameters:
      templatePath: feast-acquisition-events.cloudformation.yaml
      cloudFormationStackByTags: false
      cloudFormationStackName: mobile-purchases-feast-write-acquisition-events-bus
      prependStackToCloudFormationStackName: false

  mobile-purchases-feast-acquisition-events-router:
    type: aws-lambda
    dependencies: [mobile-purchases-feast-acquisition-events-bus-cloudformation]
    parameters:
      functionNames: [mobile-purchases-feast-acquisition-events-router-]
      fileName: feast-acquisition-events-router.zip
      bucketSsmLookup: true
      prefixStack: false

  mobile-purchases-feast-apple-acquisition-events:
    type: aws-lambda
    dependencies: [mobile-purchases-feast-acquisition-events-bus-cloudformation]
    parameters:
      functionNames: [mobile-purchases-feast-apple-acquisition-events-]
      fileName: feast-apple-acquisition-events.zip
      bucketSsmLookup: true
      prefixStack: false

  mobile-purchases-feast-google-acquisition-events:
      type: aws-lambda
      dependencies: [mobile-purchases-feast-acquisition-events-bus-cloudformation]
      parameters:
        functionNames: [mobile-purchases-feast-google-acquisition-events-]
        fileName: feast-google-acquisition-events.zip
        bucketSsmLookup: true
        prefixStack: false
