Attach IAM role

Now that you have created the EC2PowerUserRole role, you can attach it to your EC2 instance. Use these instructions.

Delete the ~/.aws/credentials file from the EC2 instance

Test that the AWS CLI still works – it should now be using credentials from the EC2PowerUserRole. Type aws s3 ls to list your S3 buckets (you should now have at least one), or aws ec2 describe-instances to get a listing if your instances (you should have at least one!).