Environment
Source:
src/AWS/MWAA/Environment.ts
An Amazon Managed Workflows for Apache Airflow (MWAA) environment — a fully managed Apache Airflow deployment that runs your DAGs.
Environments take roughly 20-30 minutes to create and are billed hourly for the environment, workers, and schedulers while they exist. Each environment needs an S3 bucket for DAG code (versioned, public access blocked), an IAM execution role, and two private subnets in distinct Availability Zones with outbound internet access (via NAT gateway or VPC endpoints). Destroy environments you are not using.
Creating an Environment
Section titled “Creating an Environment”Basic Environment
const environment = yield* Environment("Airflow", { executionRoleArn: role.roleArn, sourceBucketArn: bucket.bucketArn, dagS3Path: "dags", subnetIds: [privateSubnetA.subnetId, privateSubnetB.subnetId], airflowVersion: "2.10.3", environmentClass: "mw1.small", maxWorkers: 5,});Public Webserver with Logging
const environment = yield* Environment("Airflow", { executionRoleArn: role.roleArn, sourceBucketArn: bucket.bucketArn, dagS3Path: "dags", subnetIds: [privateSubnetA.subnetId, privateSubnetB.subnetId], webserverAccessMode: "PUBLIC_ONLY", loggingConfiguration: { schedulerLogs: { enabled: true, logLevel: "INFO" }, workerLogs: { enabled: true, logLevel: "INFO" }, taskLogs: { enabled: true, logLevel: "INFO" }, }, airflowConfigurationOptions: { "core.default_task_retries": "3", },});