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

Leverage Access Key and Secret Key for session #41

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions target_s3_parquet/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from typing import Dict, List, Optional
import awswrangler as wr
from boto3 import setup_default_session
from pandas import DataFrame
from singer_sdk import Target
from singer_sdk.sinks import BatchSink
Expand Down Expand Up @@ -35,7 +36,17 @@ def __init__(
) -> None:
super().__init__(target, stream_name, schema, key_properties)

if self._is_using_hmac():
setup_default_session(
aws_access_key_id=self.config.get("aws_access_key_id"),
aws_secret_access_key=self.config.get("aws_secret_access_key"),
)

self._glue_schema = self._get_glue_schema()

def _is_using_hmac(self) -> bool:
return isinstance(self.config.get("aws_access_key_id"), str) and \
isinstance(self.config.get("aws_secret_access_key"), str)

def _get_glue_schema(self):

Expand Down
Loading