Class: AWS::IAM::Group
- Inherits:
-
Resource
- Object
- Core::Resource
- Resource
- AWS::IAM::Group
- Defined in:
- lib/aws/iam/group.rb
Overview
Represents a group of users. Groups don’t directly interact with AWS; only users do. The main reason to create groups is to collectively assign permissions to the users so they can do their jobs. For example, you could have a group called Admins and give that group the types of permissions admins typically need.
Instance Method Summary collapse
-
#delete ⇒ Object
Deletes the group.
-
#exists? ⇒ Boolean
True if the resource exists.
-
#policies ⇒ GroupPolicyCollection
Provides access to the policies associated with the group.
-
#users ⇒ GroupUserCollection
Provides access to the users in the group.
Instance Method Details
#delete ⇒ Object
Deletes the group. The group must not contain any users or have any attached policies.
69 70 71 72 |
# File 'lib/aws/iam/group.rb', line 69 def delete client.delete_group(:group_name => name) nil end |
#exists? ⇒ Boolean
Returns True if the resource exists.
65 |
# File 'lib/aws/iam/group.rb', line 65 def exists?; super; end |
#policies ⇒ GroupPolicyCollection
Provides access to the policies associated with the group. For example:
# get the policy named "ReadOnly"
group.policies["ReadOnly"]
# remove all policies associated with the group
group.policies.clear
99 100 101 |
# File 'lib/aws/iam/group.rb', line 99 def policies GroupPolicyCollection.new(self) end |
#users ⇒ GroupUserCollection
Provides access to the users in the group. For example:
# get the names of all the users in the group
group.users.map(&:name)
# remove all users from the group
group.users.clear
84 85 86 |
# File 'lib/aws/iam/group.rb', line 84 def users GroupUserCollection.new(self) end |