class Cumulus::IAM::GroupConfig
Public: Represents a config file for a group
Attributes
users[RW]
Public Class Methods
new(name = nil, json = nil)
click to toggle source
Public: Constructor
name - the name of the group json - the Hash containing the JSON configuration for this GroupConfig
, if
nil, this will be an "empty GroupConfig"
Calls superclass method
# File lib/iam/models/GroupConfig.rb, line 17 def initialize(name = nil, json = nil) super(name, json) @type = "group" @users = json["users"] unless json.nil? end
Public Instance Methods
diff(aws_resource)
click to toggle source
override diff to check for changes in users
Calls superclass method
# File lib/iam/models/GroupConfig.rb, line 24 def diff(aws_resource) differences = super(aws_resource) aws_users = aws_resource.users.map { |user| user.name } new_users = @users.select { |local| !aws_users.include?(local) } unmanaged = aws_users.select { |aws| !@users.include?(aws) } if !unmanaged.empty? or !new_users.empty? differences << IamDiff.users(new_users, unmanaged) end differences end