Quick start tutorial for Amazon Managed Workflows for Apache Airflow (MWAA) with Terraform. This is a word for word translation of the official AWS quick start (with CloudFormation).
The recommended way to deploy MWAA's web server in production is to place it inside a private network (managed by AWS). Check aws-mwaa-terraform-private to see how that can be done.
Below is an example terraform.tfvars
file that you can use in your deployments:
region = "us-east-1"
prefix = "my-mwaa"
vpc_cidr = "10.192.0.0/16"
public_subnet_cidrs = [
"10.192.10.0/24",
"10.192.11.0/24"
]
private_subnet_cidrs = [
"10.192.20.0/24",
"10.192.21.0/24"
]
mwaa_max_workers = 2
There's a test DAG file inside the local dags
directory, which was taken from the official tutorial for Apache Airflow v1.10.12. You can place as many DAG files inside that directory as you want and Terraform will pick them up and upload them to S3.
terraform init
terraform fmt
terraform validate
terraform plan
terraform apply
terraform destroy
- For an example of a GitHub Action that syncs the DAGs subfolder automatically to S3, check stelsemeyer's implementation.