Skip to content

Commit

Permalink
added session token to duckdb s3 secret
Browse files Browse the repository at this point in the history
  • Loading branch information
jorritsandbrink committed Oct 31, 2024
1 parent 7807f0e commit c22550f
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit c22550f

Please sign in to comment.