首页 > 解决方案 > Setting AWS CLI Profile to issue bash commands against AWS

问题描述

I am trying to setup the AWS env variables for AWS profiles before I run a bash script.

If do:

export profile=$(AWS_PROFILE=name)
aws configure list

and then I echo $profile it isn't setting the profile.

标签: bashamazon-web-servicesaws-cli

解决方案


你可以使用:

export AWS_PROFILE=rodney
<call script here>

或者,您可以在脚本中指定配置文件:

aws s3 ls --profile rodney

推荐阅读