Skip to content

infrastructure

This repository contains all sources that are necessary to deploy the infrastructure for the MWAA environments of the Data and Content Delivery Team.

Development

Prerequisites

  • Node.js v22.21.1
    Check with node -v
  • pnpm 10.11.0
    Check with pnpm -v
  • AWS CLI v2.9.10 or higher
    Check with aws --version

Install dependencies

pnpm install

Prepare AWS accounts

Either copy awsconfig.example to ~/.aws/config if you do not have that file already or adapt your existing config.

To login to the respective profile, use the aws sso login command, e.g. to login to the dev environment use

aws sso login --profile=dcd-dev

which will open a browser to let you login or authenticate.

Note: The Github actions do not use the SSO profiles, simply as they do not perform SSO. Do not use the wrapper script there but instead invoke CDK directly using pnpm run cdk.

Note: all done for dev, stage and prod for the dcd accounts At first, the AWS account needs to be bootstrapped.

pnpm dlx cdk bootstrap --profile <profile>

In order for GitHub actions to deploy the infrastructure, a role with the necessary permissions must be created in the AWS account up front. This can be done by deploying the BaselineGithub stack manually.

Deploy the stack.

pnpm run deploy --what-todo deploy --env-name {dev, stage, prod} --stack-name BaselineGithub

Preview applied changes to the infrastructure with cdk diff

Preview stack diffs

pnpm run deploy --what-todo diff --env-name dev

Deploying an environment from a Local Machine

Note: Currently only "official" environments (dev, stage and prod) are supported.

pnpm run deploy --what-todo deploy --env-name dev

Linting And Formatting

We use eslint to keep the code formatted and clean.

If you encounter errors during your git commit (e.g. 'Code style issues found'), run the following commands in the root of the project:

pnpm format

Network Setup

to have the Managed Airflow work properly, the basic network setup provided by the PE/CDS team has been adjusted: read more.

Datadog integration

check the Datadog integration documentation for more information.