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
66 67 68 |
# File 'lib/vpc/loader/Loader.rb', line 66 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
36 37 38 39 40 |
# File 'lib/vpc/loader/Loader.rb', line 36 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
59 60 61 |
# File 'lib/vpc/loader/Loader.rb', line 59 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
52 53 54 |
# File 'lib/vpc/loader/Loader.rb', line 52 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
45 46 47 |
# File 'lib/vpc/loader/Loader.rb', line 45 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
29 30 31 |
# File 'lib/vpc/loader/Loader.rb', line 29 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
22 23 24 |
# File 'lib/vpc/loader/Loader.rb', line 22 def self.vpcs Common::BaseLoader::resources(@@vpcs_dir, &VpcConfig.method(:new)) end |