Skip to content
Closed
Show file tree
Hide file tree
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: 2 additions & 2 deletions lithops/serverless/backends/aws_lambda/aws_lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def __init__(self, lambda_config, internal_storage):
logger.debug('Creating Boto3 AWS Session and Lambda Client')

self.aws_session = boto3.Session(
aws_access_key_id=lambda_config['access_key_id'],
aws_secret_access_key=lambda_config['secret_access_key'],
aws_access_key_id=lambda_config.get('access_key_id'),
aws_secret_access_key=lambda_config.get('secret_access_key'),
aws_session_token=lambda_config.get('session_token'),
region_name=self.region_name
)
Expand Down
3 changes: 0 additions & 3 deletions lithops/serverless/backends/aws_lambda/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ def load_config(config_data):
if 'aws' not in config_data:
raise Exception("'aws' section is mandatory in the configuration")

if not {'access_key_id', 'secret_access_key'}.issubset(set(config_data['aws'])):
raise Exception("'access_key_id' and 'secret_access_key' are mandatory under the 'aws' section of the configuration")

if not config_data['aws_lambda']:
raise Exception("'aws_lambda' section is mandatory in the configuration")

Expand Down
35 changes: 14 additions & 21 deletions lithops/storage/backends/aws_s3/aws_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,27 +42,20 @@ def __init__(self, s3_config):
self.secret_access_key = s3_config.get('secret_access_key')
self.session_token = s3_config.get('session_token')

if self.access_key_id and self.secret_access_key:
client_config = Config(
max_pool_connections=128,
user_agent_extra=self.user_agent,
connect_timeout=CONN_READ_TIMEOUT,
read_timeout=CONN_READ_TIMEOUT,
retries={'max_attempts': OBJ_REQ_RETRIES}
)
self.s3_client = boto3.client(
's3', aws_access_key_id=self.access_key_id,
aws_secret_access_key=self.secret_access_key,
aws_session_token=self.session_token,
config=client_config,
region_name=self.region_name
)
else:
client_config = Config(
signature_version=UNSIGNED,
user_agent_extra=self.user_agent
)
self.s3_client = boto3.client('s3', config=client_config)
client_config = Config(
max_pool_connections=128,
user_agent_extra=self.user_agent,
connect_timeout=CONN_READ_TIMEOUT,
read_timeout=CONN_READ_TIMEOUT,
retries={'max_attempts': OBJ_REQ_RETRIES}
)
self.s3_client = boto3.client(
's3', aws_access_key_id=self.access_key_id,
aws_secret_access_key=self.secret_access_key,
aws_session_token=self.session_token,
config=client_config,
region_name=self.region_name
)

msg = STORAGE_CLI_MSG.format('S3')
logger.info(f"{msg} - Region: {self.region_name}")
Expand Down
3 changes: 0 additions & 3 deletions lithops/storage/backends/aws_s3/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ def load_config(config_data):

if 'aws' in config_data:

if not {'access_key_id', 'secret_access_key'}.issubset(set(config_data['aws'])):
raise Exception("'access_key_id' and 'secret_access_key' are mandatory under the 'aws' section of the configuration")

if 'aws_s3' not in config_data:
config_data['aws_s3'] = {}

Expand Down