- Newest
- Most votes
- Most comments
Hi dmitrii,
It sounds like you've already checked the MWAA documentation and tried test DAGs—let’s build on that foundation to uncover the root cause. We’ll focus on verifying the S3 bucket setup, IAM permissions, and log configurations step by step.
Let’s dig into your issue now.
Clarifying the Issue: Diagnosing AWS MWAA Not Seeing DAGs
When AWS Managed Workflows for Apache Airflow (MWAA) doesn't show DAGs, even with all log groups empty, the issue often lies with one of the following areas: S3 bucket configuration, IAM roles, or DAG file validation.
1. Verify the S3 Bucket Setup
- Correct Bucket Path: Ensure that the DAGs are in the correct S3 prefix (
dags/) as configured in MWAA. - Permissions: Confirm that the MWAA Execution Role has:
s3:GetObjectands3:ListBucketpermissions for the bucket and prefix.- Check for bucket policies blocking public access that might inadvertently restrict MWAA.
- File Format: DAG files must be
.pyfiles with no syntax errors.
Example Policy:
{ "Effect": "Allow", "Action": ["s3:GetObject", "s3:ListBucket"], "Resource": [ "arn:aws:s3:::<your-bucket-name>", "arn:aws:s3:::<your-bucket-name>/dags/*" ] }
2. IAM Role Configuration
Verify that the Execution Role attached to MWAA has the necessary permissions. Attach the AmazonMWAAFullExecutionRole policy or customize it to include S3, CloudWatch, and MWAA service permissions.
Here’s a comprehensive IAM policy example for MWAA:
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowS3AccessForDAGs", "Effect": "Allow", "Action": ["s3:GetObject", "s3:ListBucket"], "Resource": [ "arn:aws:s3:::<your-bucket-name>", "arn:aws:s3:::<your-bucket-name>/dags/*" ] }, { "Sid": "AllowLoggingToCloudWatch", "Effect": "Allow", "Action": [ "logs:CreateLogGroup", "logs:CreateLogStream", "logs:PutLogEvents", "logs:GetLogEvents" ], "Resource": "arn:aws:logs:<region>:<account-id>:log-group:airflow-*" }, { "Sid": "AllowMWAAAccessToEnvironment", "Effect": "Allow", "Action": [ "airflow:PublishMetrics", "airflow:GetEnvironment", "airflow:ListEnvironments" ], "Resource": "*" } ] }
Replace:
<your-bucket-name>with your S3 bucket name.<region>and<account-id>with your AWS region and account ID.
3. DAG File Validity
- Use
airflow dags listlocally or run the DAGs in a local Airflow environment to check for syntax errors or invalid task definitions. - Ensure all dependencies referenced in DAG files are available in the environment, including Python libraries.
- Validate that all DAGs have a proper structure, including:
from airflow import DAG from airflow.operators.dummy import DummyOperator from datetime import datetime with DAG("example_dag", start_date=datetime(2024, 1, 1), schedule_interval="@daily") as dag: task1 = DummyOperator(task_id="start")
4. Logs Configuration
If the MWAA logs remain empty, follow these troubleshooting steps:
-
Enable MWAA Logging:
- Go to the MWAA Console → select your environment → under Monitoring, confirm that the logging options are enabled for:
- Task logs
- Worker logs
- Scheduler logs
- Go to the MWAA Console → select your environment → under Monitoring, confirm that the logging options are enabled for:
-
Validate CloudWatch Log Group Configuration:
- Go to the CloudWatch Console → Logs → Log groups.
- Ensure the following log groups exist:
/aws/airflow/<environment-name>/task/aws/airflow/<environment-name>/worker/aws/airflow/<environment-name>/scheduler
- If the log groups don’t exist, ensure the MWAA Execution Role has permissions to create them.
-
Check Log Stream Creation:
- Open the corresponding log group and look for active log streams. If no log streams exist:
- Confirm MWAA can publish logs (
logs:CreateLogStreamandlogs:PutLogEventspermissions). - Restart the MWAA environment to force log creation.
- Confirm MWAA can publish logs (
- Open the corresponding log group and look for active log streams. If no log streams exist:
-
Inspect Airflow Logs Locally:
- Run your DAGs locally in a non-MWAA Airflow environment to detect errors that prevent them from loading (e.g., Python syntax errors, missing dependencies).
5. MWAA Environment Health
- Verify that the MWAA environment is in a healthy state. Restart the environment if necessary.
- Check metrics in Amazon CloudWatch to confirm that MWAA is processing DAGs.
Common Pitfall: S3 Block Public Access
Even though MWAA doesn’t require public access, the S3 Block Public Access setting can sometimes overly restrict permissions. Double-check this setting to ensure it aligns with your access policies.
Conclusion
By addressing S3 setup, IAM roles, and log configurations while validating the DAGs, you should be able to identify and resolve the issue. Let me know if you need further assistance or clarification!
Cheers, Aaron 🚀😊
answered 2 years ago
@Aaron Rose. I went through all those steps. I still don't show DAGs inside of Airflow UI. Can you please look at this ticket. It shows the full start to finish README and allows anyone to reproduce to run into the same issue. https://calendar.playmetrics.com/calendars/c540/t425104/p0/t8F4D087B/f/calendar.ics
Hi all, similar issue here. I have tried all debugging steps. If someone can reproduce this issue I posted here please let me know the solution. https://github.com/aws-ia/terraform-aws-mwaa/issues/81
answered 9 months ago
If your airflow is using public internet the we need a NAT gateway and for private we need VPC endpoint. Refer: https://docs.aws.amazon.com/mwaa/latest/userguide/networking-about.html
Relevant content
asked 3 years ago

If your airflow is using public internet the we need a NAT gateway and for private we need VPC endpoint. Refer: https://docs.aws.amazon.com/mwaa/latest/userguide/networking-about.html