module Cumulus::IAM::Loader

Public: A module that handles loading all the json configuration files and creating objects from them.

Public Class Methods

group(file) click to toggle source

Public: Load a group defined in configuration

file - the file the group definition is found in

Returns the GroupConfig object defined by the file

# File lib/iam/loader/Loader.rb, line 81
def Loader.group(file)
  Common::BaseLoader.resource(file, @@groups_dir, &@@group_loader)
end
groups() click to toggle source

Public: Load all the groups defined in configuration.

Returns an Array of GroupConfig objects defined by the groups configuration files.

# File lib/iam/loader/Loader.rb, line 72
def Loader.groups
  Common::BaseLoader.resources(@@groups_dir, &@@group_loader)
end
policy_document(file) click to toggle source

Public: Load the JSON string that is a role's policy document from a file.

file - the String name of the policy document file to load

Returns the String contents of the policy document file

# File lib/iam/loader/Loader.rb, line 110
def Loader.policy_document(file)
  policy_dir = Configuration.instance.iam.policy_document_directory
  Common::BaseLoader.load_file(file, policy_dir)
end
role(file) click to toggle source

Public: Load a role defined in configuration

file - the name of the role to load

Returns a RoleConfig object defined by the role configuration files.

# File lib/iam/loader/Loader.rb, line 48
def Loader.role(file)
  Common::BaseLoader.resource(file, @@roles_dir, &@@role_loader)
end
roles() click to toggle source

Public: Load all the roles defined in configuration.

Returns an Array of RoleConfig objects defined by the roles configuration files.

# File lib/iam/loader/Loader.rb, line 39
def Loader.roles
  Common::BaseLoader.resources(@@roles_dir, &@@role_loader)
end
static_policy(file) click to toggle source

Public: Load in a static policy as StatementConfig object

file - the String name of the static policy file to load

Returns a StatementConfig object corresponding to the static policy

# File lib/iam/loader/Loader.rb, line 90
def Loader.static_policy(file)
  Common::BaseLoader.resource(file, @@static_policy_dir, &@@policy_loader)
end
template_policy(file, variables) click to toggle source

Public: Load in a template policy, apply variables, and create a StatementConfig object from the result

file - the String name of the template policy file to load variables - a Hash of variables to apply to the template

Returns a StatementConfig object corresponding to the applied template policy

# File lib/iam/loader/Loader.rb, line 101
def Loader.template_policy(file, variables)
  Common::BaseLoader.template(file, @@template_dir, variables, &@@policy_loader)
end
user(file) click to toggle source

Public: Load a user defined in configuration

file - the file the user definition is found in

Returns the UserConfig object defined by the file.

# File lib/iam/loader/Loader.rb, line 64
def Loader.user(file)
  Common::BaseLoader.resource(file, @@users_dir, &@@user_loader)
end
users() click to toggle source

Public: Load all the users defined in configuration.

Returns an Array of UserConfig objects defined in user configuration files.

# File lib/iam/loader/Loader.rb, line 55
def Loader.users
  Common::BaseLoader.resources(@@users_dir, &@@user_loader)
end