Class: Cloudpatrol::Task::IAM
- Inherits:
-
Object
- Object
- Cloudpatrol::Task::IAM
- Defined in:
- lib/cloudpatrol/task/iam.rb
Instance Method Summary collapse
- #clean_users ⇒ Object
-
#initialize(cred) ⇒ IAM
constructor
A new instance of IAM.
Constructor Details
#initialize(cred) ⇒ IAM
Returns a new instance of IAM.
6 7 8 |
# File 'lib/cloudpatrol/task/iam.rb', line 6 def initialize cred @gate = ::AWS::IAM.new(cred) end |
Instance Method Details
#clean_users ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/cloudpatrol/task/iam.rb', line 10 def clean_users deleted = [] @gate.users.each do |user| unless user.name =~ /^_/ or user.mfa_devices.count > 0 deleted << user.inspect user.delete! end end deleted end |