I have a requirement to add my AWS access key and secret key in a set of servers (more than 100). I am trying to automate this process. The only way I have now is to create a .aws directory for the user and copy the aws credentials and config file to that directory.
Is there anyway else we can do this?
I would focus your efforts on applying an IAM Role to each instance, rather than copying your keys across to each one manually. EC2 instances making API calls outbound to your other services is a solved problem.
This requires you to re-launch your instances, but means you can easily adjust permissions via the role in the event you need to rotate your credentials.
More information is available in the AWS EC2 Documentation.