Reputation: 6019
Key pair file.pem has been downloaded to a Mac when the EC2 was created, which is used during ssh from the local machine to the EC2 Amazon Linux instance. AWS CLI just got installed as well.
CLI introductory tutorials indicate the use of a key, which seems to be different than the file.pem originally downloaded.
How can this file.pem be used with AWS CLI instead of a different authentication mechanism?
Upvotes: 0
Views: 388
Reputation: 16003
It cannot. Your ssh key allows you to connect to your instance, but to access AWS APIs you need to have AWS credentials. For instances, it is recommended to launch them with a role which sdks and the cli will pick up on and use to access other AWS resources. That role should be as restrictive as possible to meet the needs of the instance.
Upvotes: 3