Skip to main content

AWS CDK construct library for Amazon Managed Workflows for Apache Airflow (MWAA)

Project description

cdk-mwaa

This project provides an AWS CDK construct library for creating and managing Amazon Managed Workflows for Apache Airflow (MWAA) environments.

Features

  • Create and manage MWAA environments
  • Configure environment properties such as webserver access mode, Airflow version, environment class, and more
  • Validate and set default values for environment properties
  • Automatically create and configure necessary AWS resources such as S3 buckets and VPCs

Installation

To use this construct library in your AWS CDK project, add it as a dependency:

npm install cdk-mwaa
# or
yarn add cdk-mwaa

Usage

Here is an example of how to use the cdk-mwaa construct library in your AWS CDK project:

import * as path from 'node:path';
import * as cdk from 'aws-cdk-lib';
import * as mwaa from 'cdk-mwaa';

const app = new cdk.App();
const stack = new cdk.Stack(app, 'MwaaStack');

const dagStorage = new mwaa.DagStorage(stack, 'MyMwaaDagStorage', {
    bucketName: 'my-mwaa-dag-storage',
    dagsOptions: {
        localPath: path.join(__dirname, 'dags'),
        s3Path: 'dags/',
      },
    // additional configuration options...
});

new mwaa.Environment(stack, 'MyMwaaEnvironment', {
    name: 'my-mwaa-environment',
    dagStorage,
    airflowVersion: '2.10.3',
    sizing: mwaa.Sizing.mw1Micro(),
    // additional configuration options...
});

app.synth();

Enabling Secrets Backend

To enable the secrets backend for your MWAA environment, you can use the enableSecretsBackend method. This allows you to securely manage secrets and environment variables.

Here is an example of how to enable the secrets backend in your MWAA environment:

import * as cdk from 'aws-cdk-lib';
import * as mwaa from 'cdk-mwaa';

const app = new cdk.App();
const stack = new cdk.Stack(app, 'MwaaStack');

const dagStorage = new mwaa.DagStorage(stack, 'MyMwaaDagStorage', {
    bucketName: 'my-mwaa-dag-storage',
    // additional configuration options...
});

const environment = new mwaa.Environment(stack, 'MyMwaaEnvironment', {
    name: 'my-mwaa-environment',
    dagStorage,
    airflowVersion: '2.10.3',
    sizing: mwaa.Sizing.mw1Micro(),
    // additional configuration options...
});

// Enabling Secrets Backend
environment.enableSecretsBackend();

app.synth();

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdk_mwaa-0.0.21.tar.gz (99.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdk_mwaa-0.0.21-py3-none-any.whl (97.5 kB view details)

Uploaded Python 3

File details

Details for the file cdk_mwaa-0.0.21.tar.gz.

File metadata

  • Download URL: cdk_mwaa-0.0.21.tar.gz
  • Upload date:
  • Size: 99.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for cdk_mwaa-0.0.21.tar.gz
Algorithm Hash digest
SHA256 1370830d9fc7cac69967878d9165a1b4db9e643047d5b148d1cbf179d2a1462b
MD5 f22b7506db71bc36e467cd1eda4ea445
BLAKE2b-256 4545ad4b4f3ee6d7d78bb39e230d82778bc1bb19756307a041a1b9e206217e94

See more details on using hashes here.

File details

Details for the file cdk_mwaa-0.0.21-py3-none-any.whl.

File metadata

  • Download URL: cdk_mwaa-0.0.21-py3-none-any.whl
  • Upload date:
  • Size: 97.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for cdk_mwaa-0.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 bdda4386dc02c4f2f09a330026934543f47e32c555be46af65b8fde91e76187f
MD5 ea73b2ce8efb22696e22f5a9d924c1e6
BLAKE2b-256 ea372044e8c5a1a14af1282f625d2d7d6d0ca29036613eb8de9053d39d79b7bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page