aws-rotate-keys icon indicating copy to clipboard operation
aws-rotate-keys copied to clipboard

Improve error message when Reaching Quota

Open pcreux opened this issue 8 years ago • 0 comments

When you already have reached your quota, aws-rotate-keys will fail to create a new access key.

Creating access key...
/gems/aws-sdk-core-2.6.44/lib/seahorse/client/plugins/raise_response_errors.rb:15:in `call': Cannot exceed quota for AccessKeysPerUser: 2 (Aws::IAM::Errors::LimitExceeded)
/gems/2.3.0/gems/aws-rotate-keys-0.1.1/lib/aws_rotate_keys.rb:50:in `create_access_key'

We should rescue from Aws::IAM::Errors::LimitExceeded and either:

  1. Tell the user to use the aws console to delete a key they don't use (easy)
  2. Prompt the user with a list of keys and ask him to pick one to delete (harder)

pcreux avatar Jan 13 '17 17:01 pcreux