Skip to content

Commit

Permalink
make JSONFileCache a config value, defaulting to the functions CACHE_DIR
Browse files Browse the repository at this point in the history
-----------------------------

Co-authored-by: Leslie VanDeMark <[email protected]>
  • Loading branch information
kgerxhi and leslievandemark committed Feb 5, 2025
1 parent 0dbdee4 commit 0d5bdf5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tap_s3_csv/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def setup_aws_client_with_proxy(config):
proxy_role_arn = "arn:aws:iam::{}:role/{}".format(config['proxy_account_id'].replace('-', ''),
config['proxy_role_name'])
cust_role_arn = "arn:aws:iam::{}:role/{}".format(config['account_id'].replace('-', ''), config['role_name'])
credentials_cache_path = config.get("credentials_cache_path", JSONFileCache.CACHE_DIR)

# Step 1: Assume Role in Account Proxy and set up refreshable session
session_proxy = Session()
Expand All @@ -132,7 +133,7 @@ def setup_aws_client_with_proxy(config):
'DurationSeconds': 3600,
'RoleSessionName': 'ProxySession'
},
cache=JSONFileCache("/tmp")
cache=JSONFileCache(credentials_cache_path)
)

# Refreshable credentials for Account Proxy
Expand All @@ -153,7 +154,7 @@ def setup_aws_client_with_proxy(config):
'RoleSessionName': 'TapS3CSVCustSession',
'ExternalId': config['external_id']
},
cache=JSONFileCache("/tmp")
cache=JSONFileCache(credentials_cache_path)
)

# Set up refreshable session for Customer Account
Expand Down

0 comments on commit 0d5bdf5

Please sign in to comment.