I wrote a python script which is deployed in a EC2 Instance and lets say this EC2 reside in AWS account A1. Now my script from A1 want to access 10 other AWS account.
And remember I don't have any AWS_ACCESS_KEY or SECRET_KEY of any account cause using AWS_ACCESS_KEY or SECRET_KEY is strictly prohibited here.
I can easily do that if I have access key. But I can't figure it out how can I do that without access key?
Is there any possible way to do that?
The EC2 should assume an IAM Role.
Then log in to all your 10 other accounts and create roles there. These roles should give cross account access to the EC2 instance role. It is also in these roles that you define what permissions the EC2 instance should have.
Accessing multiple AWS accounts using boto3 without secret key?