Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add session token to duckdb s3 secret #2007

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions dlt/destinations/impl/filesystem/sql_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def create_authentication(self, persistent: bool = False, secret_name: str = Non
# add secrets required for creating views
if self.fs_client.config.protocol == "s3":
aws_creds = cast(AwsCredentials, self.fs_client.config.credentials)
session_token = (
"" if aws_creds.aws_session_token is None else aws_creds.aws_session_token
)
endpoint = (
aws_creds.endpoint_url.replace("https://", "")
if aws_creds.endpoint_url
Expand All @@ -100,6 +103,7 @@ def create_authentication(self, persistent: bool = False, secret_name: str = Non
TYPE S3,
KEY_ID '{aws_creds.aws_access_key_id}',
SECRET '{aws_creds.aws_secret_access_key}',
SESSION_TOKEN '{session_token}',
REGION '{aws_creds.region_name}',
ENDPOINT '{endpoint}',
SCOPE '{scope}'
Expand Down
Loading