lib/awskeyring/awsapi.rb in awskeyring-0.3.1 vs lib/awskeyring/awsapi.rb in awskeyring-0.4.0
- old
+ new
@@ -173,14 +173,14 @@
# @param [String] secret The aws_secret_access_key
# @param [String] account the associated account name.
# @return [String] key The aws_access_key_id
# @return [String] secret The aws_secret_access_key
# @return [String] account the associated account name.
- def self.rotate(account:, key:, secret:) # rubocop:disable Metrics/MethodLength
+ def self.rotate(account:, key:, secret:, key_message:) # rubocop:disable Metrics/MethodLength
iam = Aws::IAM::Client.new(access_key_id: key, secret_access_key: secret)
if iam.list_access_keys[:access_key_metadata].length > 1
- warn "You have two access keys for account #{account}"
+ warn key_message
exit 1
end
new_key = iam.create_access_key
iam = Aws::IAM::Client.new(