Class: AwsCli::CLI::IAM::Policies

Inherits:
Thor
  • Object
show all
Defined in:
lib/awscli/cli/iam/policies.rb

Instance Method Summary collapse

Instance Method Details

#addObject



17
18
19
20
21
22
23
24
# File 'lib/awscli/cli/iam/policies.rb', line 17

def add
  create_iam_object
  if !options[:user_name] and !options[:group_name] and !options[:role_name]
    puts 'should pass either --user-name or --group-name or --role-name'
    exit
  end
  @iam.add_policy_document options
end

#deleteObject



59
60
61
62
63
64
65
66
# File 'lib/awscli/cli/iam/policies.rb', line 59

def delete
  if !options[:user_name] and !options[:group_name] and !options[:role_name]
    puts 'should pass either --user-name or --group-name or --role-name'
    exit
  end
  create_iam_object
  @iam.delete_policy options
end

#listObject



45
46
47
48
49
50
51
52
# File 'lib/awscli/cli/iam/policies.rb', line 45

def list
  if !options[:user_name] and !options[:group_name] and !options[:role_name]
    puts 'should pass either --user-name or --group-name or --role-name'
    exit
  end
  create_iam_object
  @iam.list options
end