Rodney Bizzell
Rodney Bizzell

Reputation: 41

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.

Upvotes: 0

Views: 584

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269101

You could use:

export AWS_PROFILE=rodney
<call script here>

Alternatively, in the script you can specify a profile:

aws s3 ls --profile rodney

Upvotes: 1

Related Questions