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

Use default role based access for S3 instead of explicit credentials. #77

Merged
merged 1 commit into from
Mar 7, 2024
Merged
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
5 changes: 0 additions & 5 deletions lib/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ def upload_file_to_s3(bucket: str, filename: str):
Generic upload helper for s3. Could be moved over to helpers folder...
"""
s3_url = os.getenv('S3_ENDPOINT')
access_key = os.getenv('AWS_ACCESS_KEY_ID')
secret_key = os.getenv('AWS_SECRET_ACCESS_KEY')
region = os.getenv('AWS_DEFAULT_REGION')
secure = s3_url and s3_url.startswith('https')
# Set up the S3 client
s3_client = boto3.client('s3',
endpoint_url=s3_url,
aws_access_key_id=access_key,
aws_secret_access_key=secret_key,
config=Config(signature_version='s3v4'),
region_name=region,
use_ssl=secure)
# Extract the file name from the local file path
Expand Down
Loading