Hi Shashi,
You shouldn't need to change the credentials used for aws/config/root each time.
If you would like to generate credentials for different AWS roles, you have two options:
One option is to use different Vault roles, e.g.,
$ vault write aws/roles/deploy1 credential_type=assumed_role role_arns=arn:aws:iam::123456789012:role/Role1
$ vault write aws/roles/deploy2 credential_type=assumed_role role_arns=arn:aws:iam::123456789012:role/Role2
Then you can read them separately, i.e.:
$ vault write aws/sts/deploy1 ttl=15m
$ vault write aws/sts/deploy2 ttl=15m
(Note that the aws/sts path is being deprecated and exists for backwards compatibility; you can just do vault write aws/creds/deploy1 ttl=15m instead).
The other option is you can use a single Vault role that can assume both roles:
$ vault write aws/roles/deploy credential_type=assumed_role role_arns=arn:aws:iam::123456789012:role/Role1,arn:aws:iam::123456789012:role/Role2
If you do this, when you read from the role, you need to specify the specific role ARN:
$ vault write aws/creds/deploy ttl=15m role_arn=arn:aws:iam::123456789012:role/Role1
$ vault write aws/creds/deploy ttl=15m role_arn=arn:aws:iam::123456789012:role/Role2
The difference between the two approaches is that the first allows you to specify access in different Vault polices, i.e., one policy could allow access only to aws/creds/deploy1 and another policy can allow access only to aws/creds/deploy2. You could achieve the second by using the required_parameters in your policies (
https://www.vaultproject.io/docs/concepts/policies.html#required_parameters) to require a value for role_arn in writing to aws/creds/deploy, but IMHO, it's a bit messier. If the same clients should get access to both AWS roles, then it's probably simplest to use a single Vault role.
Hope this helps!
--Joel