Reputation: 13
My requirement to upload file from local to s3 using aws cli but don't want to use access ID and secret access key while running in command line.
Any suggestions!
Upvotes: 0
Views: 1319
Reputation: 269101
It is recommended that you never put AWS credentials in program code.
If the code is running on an Amazon EC2 instance, assign an IAM Role to the instance. The code will automatically detect and use these credentials.
If the code is running on your own computer, run the AWS Command-Line Interface (CLI) aws configure
command and enter your IAM credentials (Access Key + Secret Key). They will be stored in the ~/.aws/credentials
file and will be automatically accessed by your code.
Upvotes: 1