Module: Cumulus::VPC::Loader
- Includes:
- Common::BaseLoader
- Defined in:
- lib/vpc/loader/Loader.rb
Constant Summary collapse
- @@vpcs_dir =
Configuration.instance.vpc.vpcs_directory
- @@subnets_dir =
Configuration.instance.vpc.subnets_directory
- @@route_tables_dir =
Configuration.instance.vpc.route_tables_directory
- @@policies_dir =
Configuration.instance.vpc.policies_directory
- @@network_acls_dir =
Configuration.instance.vpc.network_acls_directory
Class Method Summary collapse
-
.network_acl(acl_name) ⇒ Object
Public: Load a network acl as a NetworkAclConfig.
-
.policy(policy_name) ⇒ Object
Public: Load the specified policy as a JSON object.
-
.route_table(rt_name) ⇒ Object
Public: Load a route table as a RouteTableConfig.
-
.subnet(subnet_name) ⇒ Object
Public: Load a subnet as a SubnetConfig.
-
.subnets ⇒ Object
Public: Load all subnets as SubnetConfig objects.
-
.vpc(vpc_name) ⇒ Object
Public: Load a single VPC configuration.
-
.vpcs ⇒ Object
Public: Load all the VPC configurations as VpcConfig objects.
Methods included from Common::BaseLoader
load_file, resource, resources, template
Class Method Details
.network_acl(acl_name) ⇒ Object
Public: Load a network acl as a NetworkAclConfig
Returns the NetworkAclConfig
68 69 70 |
# File 'lib/vpc/loader/Loader.rb', line 68 def self.network_acl(acl_name) Common::BaseLoader::resource(acl_name, @@network_acls_dir, &NetworkAclConfig.method(:new)) end |
.policy(policy_name) ⇒ Object
Public: Load the specified policy as a JSON object
Returns the JSON object for the policy
38 39 40 41 42 |
# File 'lib/vpc/loader/Loader.rb', line 38 def self.policy(policy_name) Common::BaseLoader::resource(policy_name, @@policies_dir) do |policy_name, policy| policy end end |
.route_table(rt_name) ⇒ Object
Public: Load a route table as a RouteTableConfig
Returns the RouteTableConfig
61 62 63 |
# File 'lib/vpc/loader/Loader.rb', line 61 def self.route_table(rt_name) Common::BaseLoader::resource(rt_name, @@route_tables_dir, &RouteTableConfig.method(:new)) end |
.subnet(subnet_name) ⇒ Object
Public: Load a subnet as a SubnetConfig
Returns the SubnetConfig
54 55 56 |
# File 'lib/vpc/loader/Loader.rb', line 54 def self.subnet(subnet_name) Common::BaseLoader::resource(subnet_name, @@subnets_dir, &SubnetConfig.method(:new)) end |
.subnets ⇒ Object
Public: Load all subnets as SubnetConfig objects
Returns an array of SubnetConfig
47 48 49 |
# File 'lib/vpc/loader/Loader.rb', line 47 def self.subnets Common::BaseLoader::resources(@@subnets_dir, &SubnetConfig.method(:new)) end |
.vpc(vpc_name) ⇒ Object
Public: Load a single VPC configuration
Returns a VpcConfig
31 32 33 |
# File 'lib/vpc/loader/Loader.rb', line 31 def self.vpc(vpc_name) Common::BaseLoader::resource(vpc_name, @@vpcs_dir, &VpcConfig.method(:new)) end |
.vpcs ⇒ Object
Public: Load all the VPC configurations as VpcConfig objects
Returns an array of VpcConfig
24 25 26 |
# File 'lib/vpc/loader/Loader.rb', line 24 def self.vpcs Common::BaseLoader::resources(@@vpcs_dir, &VpcConfig.method(:new)) end |