# yaml-language-server: $schema=../../schemas/@aws-mdaa/cli.json
# All resources will be deployed to the default region specified in the environment or AWS configurations.
# Can optional specify a specific AWS Region Name.
region: default

# Tags applied to all deployed resources
tag_config_data:
  costcentre: '123456'
  project: data-ecosystem

## Pre-Deployment Instructions

# Failure to do so may result in global naming conflicts.
# TODO: Set a globally unique organization name (used in S3 bucket names and resource prefixes)
organization: <YOUR_ORG_NAME>

context:
  # TODO: Set the source relational database name for DMS
  dms-source-db: <YOUR_DMS_SOURCE_DB>
  # TODO: Set the ARN of the Secrets Manager secret containing RDS credentials
  dms-rds-secrets-arn: <YOUR_SECRET_ARN>
  # TODO: Set the ARN of the KMS key used to encrypt the secret
  dms-rds-secrets-kms-arn: <YOUR_KMS_ARN>
  # TODO: Set your VPC ID
  vpc_id: <YOUR_VPC_ID>
  # TODO: Set private subnet ID 1
  subnet_id1: <YOUR_SUBNET_ID_1>
  # TODO: Set private subnet ID 2
  subnet_id2: <YOUR_SUBNET_ID_2>
  # TODO: Set the hour (0-23) for file processor EventBridge trigger
  file_processor_event_bridge_trigger_hour: <YOUR_HOUR>
  # TODO: Set the rate in days for file processor runs
  file_processor_event_bridge_trigger_rate: <YOUR_INT>
  # TODO: Set the rate in days for transformation runs
  transformation_event_bridge_trigger_rate: <YOUR_INT_2>
  # TODO: Set the hour (0-23) for transformation EventBridge trigger
  transformation_event_bridge_trigger_hour: <YOUR_HOUR_2>

# One or more domains may be specified. Domain name will be incorporated by default naming implementation
# to prefix all resource names.
domains:
  # The named of the domain. In this case, we are building a 'shared' domain.
  shared:
    # One or more environments may be specified, typically along the lines of 'dev', 'test', and/or 'prod'
    environments:
      # The environment name will be incorporated into resource name by the default naming implementation.
      dev:
        # The target deployment account can be specified per environment.
        # If 'default' or not specified, the account configured in the environment will be assumed.
        account: default
        # The list of modules which will be deployed. A module points to a specific MDAA CDK App, and
        # specifies a deployment configuration file if required.
        modules:
          # This module will create all the roles required for the datalake, as well as dataops layers running on top
          roles: # The module name (ie 'roles') will be incorporated into resource name by the default naming implementation.
            module_path: "@aws-mdaa/roles"
            module_configs:
              - ./roles.yaml

          # This module will deploy the S3 data lake buckets.
          # Coarse grained access may be granted directly to S3 for certain roles.
          datalake:
            module_path: "@aws-mdaa/datalake"
            module_configs:
              - ./datalake/datalake.yaml

          # This module will ensure that LakeFormation is configured to
          # automatically generate IAMAllowedPrincipal grants on new databases and tables.
          # This effectively delegates all Glue resource access controls
          # to IAM.
          # NOTE: Account-level module — can only be deployed once per AWS account.
          lakeformation-settings:
            module_path: "@aws-mdaa/lakeformation-settings"
            module_configs:
              - ./datalake/lakeformation-settings.yaml

          # This module will create an Athena Workgroup which can be used to query
          # the data lake.
          athena:
            module_path: "@aws-mdaa/athena-workgroup"
            module_configs:
              - ./datalake/athena.yaml

          # This module will create a secure S3-based bucket for use as a Cloudtrail Inventory target.
          audit:
            module_path: "@aws-mdaa/audit"
            module_configs:
              - ./governance/audit.yaml

          # This module will create a secure S3-based Audit Trail.
          audit-trail:
            module_path: "@aws-mdaa/audit-trail"
            module_configs:
              - ./governance/audit-trail.yaml

          # This module will ensure the Glue Catalog is KMS encrypted.
          # NOTE: Account-level module — can only be deployed once per AWS account.
          glue-catalog:
            module_path: "@aws-mdaa/glue-catalog"

  # The named of the domain. In this case, we are building a 'dataops' domain.
  dataops:
    # One or more environments may be specified, typically along the lines of 'dev', 'test', and/or 'prod'
    environments:
      # The environment name will be incorporated into resource name by the default naming implementation.
      dev:
        # The target deployment account can be specified per environment.
        # If 'default' or not specified, the account configured in the environment will be assumed.
        account: default
        # The list of modules which will be deployed. A module points to a specific MDAA CDK App, and
        # specifies a deployment configuration file if required.
        modules:
          # This module will create all the roles required for the datalake, as well as dataops layers running on top
          roles: # The module name (ie 'roles') will be incorporated into resource name by the default naming implementation.
            module_path: "@aws-mdaa/roles"
            module_configs:
              - ./dataops/roles.yaml

          # This module will create DataOps Project resources which can be shared
          # across multiple
          hda-project:
            module_path: "@aws-mdaa/dataops-project"
            module_configs:
              - ./dataops/project.yaml
          dynamodb-tables:
            module_path: "@aws-mdaa/dataops-dynamodb"
            module_configs:
              - ./dataops/dynamodb.yaml
          # This module will ensure the Glue Catalog is KMS encrypted.
          glue-jobs:
            module_path: "@aws-mdaa/dataops-job"
            module_configs:
              - ./dataops/jobs.yaml
          # file manager to manage data from the staging bucket
          hda-function:
            module_path: "@aws-mdaa/dataops-lambda"
            module_configs:
              - ./dataops/lambda.yaml
          file-workflow:
            module_path: "@aws-mdaa/dataops-stepfunction"
            module_configs:
              - ./dataops/stepfunction.yaml
            postdeploy:
              command: "./dataops/scripts/load_batch_config.sh"
              exit_if_fail: true
          # actions and resources created before other dms modules
          dms-shared:
            predeploy:
              command: "./dataops/scripts/load_table_info.sh table_config.json"
              exit_if_fail: true
            module_path: "@aws-mdaa/dataops-dms"
            module_configs:
              - ./dataops/dms-shared.yaml
          dms:
            module_path: "@aws-mdaa/dataops-dms"
            module_configs:
              - ./dataops/dms.yaml
