pankajastro commented on code in PR #38536:
URL: https://github.com/apache/airflow/pull/38536#discussion_r1581163636
##########
airflow/providers/hashicorp/_internal_client/vault_client.py:
##########
@@ -318,15 +321,36 @@ def _auth_azure(self, _client: hvac.Client) -> None:
)
def _auth_aws_iam(self, _client: hvac.Client) -> None:
- if self.auth_mount_point:
- _client.auth.aws.iam_login(
- access_key=self.key_id,
- secret_key=self.secret_id,
- role=self.role_id,
- mount_point=self.auth_mount_point,
- )
+ if self.key_id and self.secret_id:
+ auth_args = {
+ "access_key": self.key_id,
+ "secret_key": self.secret_id,
+ "role": self.role_id,
+ }
else:
- _client.auth.aws.iam_login(access_key=self.key_id,
secret_key=self.secret_id, role=self.role_id)
+ import boto3
+
+ if self.role_arn:
+ sts_client = boto3.client("sts")
+ credentials = sts_client.assume_role(RoleArn=self.role_arn,
RoleSessionName="airflow")
Review Comment:
wdyt https://github.com/apache/airflow/pull/39279
```
AIRFLOW__SECRETS__BACKEND_KWARGS='{"kv_engine_version": 1, "mount_point":
"kv", "variables_path": "airflow", "url": "http://127.0.0.0:8200/",
"auth_type": "aws_iam", "assume_role_kwargs": {"RoleArn":
"arn:aws:iam::1234567890000:role/hashicorp-aws-iam", "RoleSessionName":
"airflow", "DurationSeconds": 900}}'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]