- Newest
- Most votes
- Most comments
The "Forbidden" error you're encountering when accessing the Apache Airflow UI is likely due to missing IAM permissions. The issue is that your IAM role or user doesn't have the required permission to access the Airflow UI.
To fix this issue, you need to add the airflow:CreateWebLoginToken permission to the IAM role or user that you're using to access the Airflow UI. This permission is essential for generating the web login token required to access the Airflow web interface.
Add the following policy statement to your IAM role or user:
iam.PolicyStatement( effect=iam.Effect.ALLOW, actions=["airflow:CreateWebLoginToken"], resources=[f"arn:aws:airflow:{region}:{account_id}:role/{airflow_env_name}/Admin"] )
Replace region with your AWS Region, account_id with your AWS account ID, and ensure airflow_env_name matches your environment name. The /Admin part specifies the RBAC role - you can use other roles like Op, User, Viewer, or Public depending on the level of access you need.
For your CDK code, you should add this permission to the IAM role or user that you're using to access the Airflow UI, not to the MWAA execution role that you've shown in your code. The execution role is for the Airflow environment itself, while you need to ensure your user/role has the proper permissions to access the UI.
If you're using a bastion host for port forwarding, also make sure that your network configuration allows access to the MWAA web server endpoint and that your VPC security groups, network ACLs, and route tables are properly configured.
Sources
Troubleshoot Apache Airflow UI access issues in MWAA | AWS re:Post
CreateWebLoginToken - Amazon Managed Workflows for Apache Airflow
Troubleshooting: Creating and updating an Amazon MWAA environment - Amazon Managed Workflows for Apache Airflow
answered 10 months ago
Relevant content
asked 10 months ago
asked 10 months ago
asked 5 years ago
