Last active
April 2, 2024 13:42
-
-
Save iamjenechka/bd068f7077b117f085ebdaf7d14b254c to your computer and use it in GitHub Desktop.
Getting s3 connection uri for airflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from airflow.models.connection import Connection | |
c = Connection( | |
conn_id='s3conn', | |
conn_type='s3', | |
extra=json.dumps({"host":"http://hostname/", "aws_access_key_id":"id", "aws_secret_access_key": "secret"}), | |
) | |
c.get_uri() | |
>>> 's3://?host=http%3A%2F%2Fhostname%2F&aws_access_key_id=id&aws_secret_access_key=secret' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment