I am trying to use Amazon S3 to upload/download some images and videos from inside my locally running NodeJS application. But when I search for that, there are tons of different code snippets and different credential management approaches and I am totally confused by that.
I created an IAM user and I have AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_BUCKET_NAME
in my .env
file but I think it's not a good approach using .env
file in my app and it's better I use temporary token credentials. But I don't know how?
What is the minimum secure code I can use to do that?