Skip to content

Commit

Permalink
Fix AWS env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
anuvgupta committed Jan 4, 2025
1 parent cf13c88 commit d890fbd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Output images by default are returned in base64 format form the serverless API.
```
ENABLE_S3_UPLOAD="TRUE"
AWS_ACCESS_KEY="<aws-access-key-contents>"
AWS_SECRET_KEY="<aws-secret-key-contents>"
AWS_ACCESS_KEY_ID="<aws-access-key-contents>"
AWS_SECRET_ACCESS_KEY="<aws-secret-key-contents>"
AWS_BUCKET_NAME="<aws-bucket-name>"
AWS_REGION="<aws-bucket-upload-region>"
```
Expand Down
8 changes: 4 additions & 4 deletions src/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
MODEL_CACHE_PATH = "/runpod-volume/models" if PROD else MODEL_CACHE_PATH_DEV
# AWS config
ENABLE_S3_UPLOAD = os.getenv('ENABLE_S3_UPLOAD', 'FALSE') == 'TRUE'
AWS_ACCESS_KEY = os.getenv('AWS_ACCESS_KEY', '')
AWS_SECRET_KEY = os.getenv('AWS_SECRET_KEY', '')
AWS_ACCESS_KEY_ID = os.getenv('AWS_ACCESS_KEY_ID_ID', '')
AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_ACCESS_KEY', '')
AWS_BUCKET_NAME = os.getenv('AWS_BUCKET_NAME', '')
AWS_REGION_DEFAULT = 'us-east-1'
AWS_REGION = os.getenv('AWS_REGION', AWS_REGION_DEFAULT)
Expand Down Expand Up @@ -256,8 +256,8 @@ def get_s3_client():
print("Connecting to S3")
s3_client = boto3.client(
's3',
aws_access_key_id=AWS_ACCESS_KEY,
aws_secret_access_key=AWS_SECRET_KEY,
AWS_ACCESS_KEY_ID_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION
)
print("Connected to S3")
Expand Down

0 comments on commit d890fbd

Please sign in to comment.