You can work with two accounts by creating two profiles on the aws command line. He will offer you the AWS passkey identifier, the AWS secret passkey, and the desired area so that they are ready.
Examples:
$ aws configure --profile account1 $ aws configure --profile account2
Then you can switch between accounts by passing the profile on the team.
$ aws dynamodb list-tables --profile account1 $ aws s3 ls --profile account2
Note:
If you name the default profile, it will become the default profile , i.e. when there is no --profile option in the command.
Learn more about the default profile.
If you spend more time using Account1, you can do this by default by setting the AWS_DEFAULT_PROFILE environment variable. When the default environment variable is set, you do not need to specify a profile for each command.
Linux, OS X Example:
$ export AWS_DEFAULT_PROFILE=account1 $ aws dynamodb list-tables
Windows example:
$ set AWS_DEFAULT_PROFILE=account1 $ aws s3 ls
iBrianCox Dec 12 '15 at 23:06 2015-12-12 23:06
source share