Setup Reference: Link
2) CLI on EC2 Machines
Already Available for use
3) AWS SDK on Local Computer
4) AWS SDK on EC2 Machines
5) AWS Instance Metadata on EC2
Give permission through assigning IAM Roles to EC2 Instances instead of configuring with secret access key and id
Configure CLI using Access Key to access your AWS account through the web. By using Access key, the user's permission are delegated to your CLI.
1) Execute "aws configure"
2) Specify Access Key ID / Secret Access Key / Default Region
3) Verify configuration with ls ~/.aws, you should see "config" and "credentials"
AWS documentaries for CLI Commands
Reference Site: Link
Specify –dry-run in your command if you wish to test out a command without it really executing
For determining what is preventing access, you can decode the authorization message
Reference Site: Link
Command to configure profile for storing access key details of other accounts:
Run command with another account's permission: