Compare commits

...

2 Commits

Author SHA1 Message Date
Michael Meidlinger 9d7a892355
Merge 32cfd1ed52 into 18b8f9ab4b 2024-03-10 12:51:12 -07:00
Michael Meidlinger 32cfd1ed52 Change how backup.py script deals with S3 backups.
In case that no static AWS credentials are specified, we try to create the boto3 client without explicitly passing static credentials. This way, we can benedit from dynamic credentials in AWS environments (e.g. using EC2 instance roles)
2023-05-19 13:25:18 +02:00
1 changed files with 7 additions and 4 deletions

View File

@ -512,6 +512,9 @@ def list_target_files(config):
# connect to the region & bucket # connect to the region & bucket
try: try:
if config['target_user'] == "" and config['target_pass'] == "":
s3 = boto3.client('s3', endpoint_url=f'https://{target.hostname}')
else:
s3 = boto3.client('s3', \ s3 = boto3.client('s3', \
endpoint_url=f'https://{target.hostname}', \ endpoint_url=f'https://{target.hostname}', \
aws_access_key_id=config['target_user'], \ aws_access_key_id=config['target_user'], \