Configure AWS IAM Identity Center¶
In order to use the AWS auth manager, you first need to configure AWS IAM Identity Center. AWS IAM Identity Center is used by the AWS auth manager for authentication purposes (login and logout). Following configuration, the Airflow environment administrator can manage users and groups with Identity Center service.
Create resources¶
The AWS auth manager needs two resources in AWS IAM Identity Center: an instance and an application. You can must create them manually.
Create the instance¶
The AWS auth manager leverages SAML 2.0 as the underlying technology powering authentication against AWS Identity Center.
There are several instance types, but only Organization level instances can use SAML 2.0 applications. See more details about instances types here.
Please follow AWS documentation to create the AWS IAM Identity Center instance at the organization level.
Create the application¶
Please follow the instructions below to create the AWS IAM Identity Center application.
Open the IAM Identity Center console.
Choose Applications.
Choose the Customer managed tab.
Choose Add application.
On the Select application type page, under Setup preference, choose I have an application I want to set up.
Under Application type, choose SAML 2.0.
Choose Next.
On the Configure application page, under Configure application, enter a Display name for the application, such as
Airflow
. Then, enter a Description.Under IAM Identity Center metadata, copy the address of the IAM Identity Center SAML metadata file.
Note
You will need to set this address in Airflow configuration later.
Under Application metadata, choose Manually type your metadata values. Then, provide the Application ACS URL and Application SAML audience as follows.
Important
Replace
<base_url>
by the base URL of your Airflow UI. It should be defined inAIRFLOW__WEBSERVER__BASE_URL
(e.g.localhost:8080
if Airflow is running locally).
Application ACS URL:
<base_url>/login_callback
Application SAML audience:
<base_url>/login_metadata
Choose Submit. The application is now created.
Attribute mappings configuration¶
Once the application is created, you need to configure the attribute mappings.
Go to the details page of the application that you just created.
Choose Actions.
Under Actions, choose Edit attribute mappings.
On the Attribute mappings page, you need to configure the different attribute mappings between your identity source and AWS IAM Identity Center. For more information on attribute mappings, see the IAM Identity Center documentation. The AWS auth manager needs two attributes: id and groups. If you use the default Identity Center directory as identity source, you can use the configuration below:
id
User attribute in the application:
id
Maps to this string value or user attribute in IAM Identity Center:
${user:AD_GUID}
Format:
basic
groups
User attribute in the application:
groups
Maps to this string value or user attribute in IAM Identity Center:
${user:groups}
Format:
basic
Once both attributes id and groups are defined, choose Save changes.
Configure Airflow¶
You need to set in Airflow configuration the IAM Identity Center SAML metadata file created previously.
[aws_auth_manager]
saml_metadata_url = <saml_metadata_file_url>
or
export AIRFLOW__AWS_AUTH_MANAGER__SAML_METADATA_URL='<saml_metadata_file_url>'