Reputation: 111
For security reasons, we have a dev, QA, and a prod AWS account. We are using IAM roles for instances. This is working correctly per account basis.
Now the recruitment here is we want to access multiple aws services {such as S3, SQS, SNS, EC2,etc.} on one of EC2 instance of QA account from Dev aws account.
We have created STS policy and role allowing Trusted entities as another AWS account, but somehow not able to attach this role to EC2 instance.
Example STS policy:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::546161XXXXXX:role/AdminAccessToAnotherAccount"
}
}
AdminAccessToAnotherAccount: This aws policy on another account with admin access.
This role is not listed while attaching to the ec2 instance.
Upvotes: 0
Views: 3200
Reputation: 269091
It appears that your situation is:
The following steps can enable this:
aws configure --profile foo
or an API call).
aws configure
, you will also need to manually edit the ~/.aws/credentials
file to add the aws_session_token
to the profile, since it is not requested by the CLI command.Examples:
Upvotes: 5