Skip to content
Discussion options

You must be logged in to vote

Airflow has its own URI format described here: https://airflow.apache.org/docs/apache-airflow/stable/howto/connection.html#connection-uri-format

So, in your case:

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'

So, conn_uri should be s3://?host=http%3A%2F%2Fhostname%2F&aws_access_key_id=id&aws_secret_access_key=secret

Try making a URI using the example :)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@damonearp
Comment options

@kbumsik
Comment options

Answer selected by damonearp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants