-
There are two ways. (This example uses dotenv)
- dotenv file
AWS_ACCESS_KEY_ID='' AWS_SECRET_ACCESS_KEY='' REGION='' BUCKET=''
- AWS CLI
aws configure
- Setting Up S3 for Your Heroku App
heroku config:set AWS_ACCESS_KEY_ID=MY-ACCESS-ID AWS_SECRET_ACCESS_KEY=MY-ACCESS-KEY REGION=MY-REGION BUCKET=MY-BUCKET-NAME Adding config vars and restarting app... done, v21 AWS_ACCESS_KEY_ID => MY-ACCESS-ID AWS_SECRET_ACCESS_KEY => MY-ACCESS-KEY
- Visit Security credentials TAB in Identity and Access Management(IAM)
- Create access key
- Get access key ID and secret key
- Permissions TAB in a Bucket
- Block public access(butket settings) -> uncheck all
- Object Owenership -> Select ALCs enabled and Object writer.