MWAA retrieving aws_default connection from Secrets Manager millions of times per month

1

We have a small environment (~30 DAGs) running Airflow 2.2.2 with Secrets Manager as our secrets backend. We noticed once we switched to Secrets Manager that MWAA was retrieving the aws_default connection from Secrets Manager multiple times per second.

After digging into the logs, it seems to be the scheduler making all the calls but I'm not sure if that's normal behavior or what needs to change in our configuration to get the environment to search elsewhere for the execution role credentials.

  • Were you able to every find a solution to this issue? I would like to not spend $20 a month on bogus api calls.

2 個答案
0

You can control the Secrets Manager API call by MWAA by having "connections_lookup_pattern" with "secrets.backend_kwargs" configuration.

Configuring an Apache Airflow connection using a AWS Secrets Manager secret - Step two: Create the Secrets Manager backend as an Apache Airflow configuration option - https://docs.aws.amazon.com/mwaa/latest/userguide/connections-secrets-manager.html#connections-sm-aa-configuration

https://airflow.apache.org/docs/apache-airflow-providers-amazon/7.3.0/_api/airflow/providers/amazon/aws/secrets/secrets_manager/index.html

Note if you are using the 7.3 provider version and you are on private you will need to update it in your plugins.zip. Do not follow instructions that tell you to put a constraints.txt in you dags folder it will not upload and will crash your EVN.

Keegan
已回答 1 年前
-1

Every time a boto session is created many log lines are added regarding how the session was constructed. Looks like change has been pushed to change the logging to debug . please find
https://github.com/apache/airflow/pull/20858

已回答 1 年前
  • I saw that, but my issue isn't necessarily with it spamming the logs, but making millions of calls to Secrets Manager per month. I'd like to be able to point it somewhere else when creating a boto session (especially since it's not actually using the credentials from Secrets Manager to do create that Session).

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南