Skip to content

Commit 501d1bc

Browse files
committed
explicitly using aws config in boto
1 parent 0c0cedb commit 501d1bc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

api/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from fastapi.middleware.cors import CORSMiddleware
33
import qrcode
44
import boto3
5+
import os
56
from io import BytesIO
67

78
# Loading Environment variable (AWS Access Key and Secret Key)
@@ -23,7 +24,11 @@
2324
)
2425

2526
# AWS S3 Configuration
26-
s3 = boto3.client('s3')
27+
s3 = boto3.client(
28+
's3',
29+
aws_access_key_id= os.getenv("AWS_ACCESS_KEY"),
30+
aws_secret_access_key= os.getenv("AWS_SECRET_KEY"))
31+
2732
bucket_name = 'YOUR_BUCKET_NAME' # Add your bucket name here
2833

2934
@app.post("/generate-qr/")

0 commit comments

Comments
 (0)