Skip to content Skip to sidebar Skip to footer

Credentials Can't Be Located For S3 Flask App In Heroku

My flask app works locally with AWS S3 bucket, but when I try to get it to work in Heroku, I keep getting this error 2020-06-07T00:58:29.174989+00:00 app[web.1]: File '/app/.hero

Solution 1:

I am not certain if providing authentication parameters to the client method will extend to calling resource. Is it possible that boto3.resource isn't authenticated on heroku but can get authentication on your local machine through environment variables or the .aws directory. Have you tried setting the secrets as environment variables (see:https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html) in Heroku, or using an authenticated session to create the resource:

session = boto3.Session( aws_access_key_id=AWS_ACCESS_KEY_ID, aws_secret_access_key=AWS_SECRET_ACCESS_KEY)

s3 = session.resource('s3')

Post a Comment for "Credentials Can't Be Located For S3 Flask App In Heroku"