Bash script to install AWS CLI tools

醉酒当歌 提交于 2019-12-03 10:36:37

Use a configuration file rather than the aws configure command. Create a file called ~/.aws/config that looks like this:

[default]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
region=us-west-2
output=json

More info in the docs.

the best practice is to install the awscli utility by BASH and copy the file from your own specified location of 2 files

without hitting

#aws configure 

command these files will not get created, you can copy and paste the files using bash script and get all the execution done

~/.aws/credintials
~/.aws/config

where credentials contains

[default]
aws_access_key_id=ABCDEFGHIJKLMNOP
aws_secret_access_key=xbdwsdADDS/ssfsfa/afzfASADQASAd

and config file contains

[default]
output=json
region=us-west-2

This will help you to keep the keys at one place and you can also push the same for your execution for any CMT tool as well like Ansible.

michael emens

you additionally configure this from the command line which will create the configuration file

aws configure set aws_access_key_id ABCDEFGHIJKLMNOP
aws configure set aws_secret_access_key xbdwsdADDS/ssfsfa/afzfASADQASAd
aws configure set default.region eu-west-1
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!