Class: VPC::Configuration
- Inherits:
-
Object
- Object
- VPC::Configuration
- Includes:
- ConfigurationHelper
- Defined in:
- lib/etude_for_aws/vpc/configuration.rb
Direct Known Subclasses
Constant Summary
Constants included from ConfigurationHelper
ConfigurationHelper::YAML_FILE
Instance Attribute Summary collapse
-
#internet_gateway ⇒ Object
readonly
Returns the value of attribute internet_gateway.
-
#private_route_tables ⇒ Object
readonly
Returns the value of attribute private_route_tables.
-
#private_subnets ⇒ Object
readonly
Returns the value of attribute private_subnets.
-
#public_route_tables ⇒ Object
readonly
Returns the value of attribute public_route_tables.
-
#public_subnets ⇒ Object
readonly
Returns the value of attribute public_subnets.
-
#route_table_names ⇒ Object
readonly
Returns the value of attribute route_table_names.
-
#subnet_names ⇒ Object
readonly
Returns the value of attribute subnet_names.
-
#vpc_cidr_block ⇒ Object
readonly
Returns the value of attribute vpc_cidr_block.
-
#vpc_group_tag ⇒ Object
readonly
Returns the value of attribute vpc_group_tag.
-
#vpc_name ⇒ Object
readonly
Returns the value of attribute vpc_name.
-
#vpc_name_tag ⇒ Object
readonly
Returns the value of attribute vpc_name_tag.
-
#vpn_info ⇒ Object
readonly
Returns the value of attribute vpn_info.
Instance Method Summary collapse
- #get_internet_gateway_name ⇒ Object
- #get_vpn_connections ⇒ Object
- #get_vpn_customer_gateways ⇒ Object
- #get_vpn_gateway ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Methods included from ConfigurationHelper
#get_yaml_destination_cidr_block, #get_yaml_ec2_config, #get_yaml_ec2_instances, #get_yaml_internet_gateway, get_yaml_region, #get_yaml_stack_name, #get_yaml_stack_tag_value, #get_yaml_subnet_cidr_block, #get_yaml_subnet_cidr_block_private, #get_yaml_subnet_cidr_block_public, #get_yaml_template_file, #get_yaml_template_path, #get_yaml_vpc_cidr_block, #get_yaml_vpc_route_tables, #get_yaml_vpc_subnets, #get_yaml_vpc_tags, #get_yaml_vpn_info, #get_yaml_zas, load_yaml_file
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 18 def initialize = @vpc_name = ['NAME']['VALUE'] @vpc_group_name = ['GROUP']['VALUE'] @vpc_cidr_block = get_yaml_vpc_cidr_block vpc_subnets = get_yaml_vpc_subnets @subnet_names = [] vpc_subnets['PUBLIC'].each do |v| @subnet_names << v['CONFIG']['SUBNET_TAGS'].first['NAME']['VALUE'] end vpc_subnets['PRIVATE'].each do |v| @subnet_names << v['CONFIG']['SUBNET_TAGS'].first['NAME']['VALUE'] end @public_subnets = vpc_subnets['PUBLIC'] @private_subnets = vpc_subnets['PRIVATE'] vpc_route_tables = get_yaml_vpc_route_tables @route_table_names = [] vpc_route_tables['PUBLIC'].each do |v| @route_table_names << v['CONFIG']['ROUTE_TABLE_TAGS'].first['NAME']['VALUE'] end vpc_route_tables['PRIVATE'].each do |v| @route_table_names << v['CONFIG']['ROUTE_TABLE_TAGS'].first['NAME']['VALUE'] end @public_route_tables = vpc_route_tables['PUBLIC'] @private_route_tables = vpc_route_tables['PRIVATE'] @internet_gateway = get_yaml_internet_gateway @vpc_name_tag = {key: ['NAME']['KEY'], value: @vpc_name} @vpc_group_tag = {key: ['GROUP']['KEY'], value: @vpc_group_name} @vpn_info = get_yaml_vpn_info end |
Instance Attribute Details
#internet_gateway ⇒ Object (readonly)
Returns the value of attribute internet_gateway.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def internet_gateway @internet_gateway end |
#private_route_tables ⇒ Object (readonly)
Returns the value of attribute private_route_tables.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def private_route_tables @private_route_tables end |
#private_subnets ⇒ Object (readonly)
Returns the value of attribute private_subnets.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def private_subnets @private_subnets end |
#public_route_tables ⇒ Object (readonly)
Returns the value of attribute public_route_tables.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def public_route_tables @public_route_tables end |
#public_subnets ⇒ Object (readonly)
Returns the value of attribute public_subnets.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def public_subnets @public_subnets end |
#route_table_names ⇒ Object (readonly)
Returns the value of attribute route_table_names.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def route_table_names @route_table_names end |
#subnet_names ⇒ Object (readonly)
Returns the value of attribute subnet_names.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def subnet_names @subnet_names end |
#vpc_cidr_block ⇒ Object (readonly)
Returns the value of attribute vpc_cidr_block.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def vpc_cidr_block @vpc_cidr_block end |
#vpc_group_tag ⇒ Object (readonly)
Returns the value of attribute vpc_group_tag.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def vpc_group_tag @vpc_group_tag end |
#vpc_name ⇒ Object (readonly)
Returns the value of attribute vpc_name.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def vpc_name @vpc_name end |
#vpc_name_tag ⇒ Object (readonly)
Returns the value of attribute vpc_name_tag.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def vpc_name_tag @vpc_name_tag end |
#vpn_info ⇒ Object (readonly)
Returns the value of attribute vpn_info.
5 6 7 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 5 def vpn_info @vpn_info end |
Instance Method Details
#get_internet_gateway_name ⇒ Object
54 55 56 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 54 def get_internet_gateway_name internet_gateway['IG_TAGS']['NAME']['VALUE'] end |
#get_vpn_connections ⇒ Object
66 67 68 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 66 def get_vpn_connections vpn_info['VPN_CONNECTIONS'] end |
#get_vpn_customer_gateways ⇒ Object
58 59 60 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 58 def get_vpn_customer_gateways vpn_info['CUSTOMER_GATEWAYS'] end |
#get_vpn_gateway ⇒ Object
62 63 64 |
# File 'lib/etude_for_aws/vpc/configuration.rb', line 62 def get_vpn_gateway vpn_info['VPN_GATEWAY'] end |