Module: ConfigurationHelper
- Included in:
- CFM::Configuration, EC2::Configuration, VPC::Configuration
- Defined in:
- lib/etude_for_aws/helpers/configuration_helper.rb
Constant Summary collapse
- YAML_FILE =
'aws_config.yml'
Class Method Summary collapse
Instance Method Summary collapse
- #get_yaml_destination_cidr_block ⇒ Object
- #get_yaml_ec2_config ⇒ Object
- #get_yaml_ec2_instances ⇒ Object
- #get_yaml_internet_gateway ⇒ Object
- #get_yaml_stack_name ⇒ Object
- #get_yaml_stack_tag_value ⇒ Object
- #get_yaml_subnet_cidr_block ⇒ Object
- #get_yaml_subnet_cidr_block_private ⇒ Object
- #get_yaml_subnet_cidr_block_public ⇒ Object
- #get_yaml_template_file(type) ⇒ Object
- #get_yaml_template_path ⇒ Object
- #get_yaml_vpc_cidr_block ⇒ Object
- #get_yaml_vpc_route_tables ⇒ Object
- #get_yaml_vpc_subnets ⇒ Object
- #get_yaml_vpc_tags ⇒ Object
- #get_yaml_vpn_info ⇒ Object
- #get_yaml_zas ⇒ Object
Class Method Details
.get_yaml_region ⇒ Object
10 11 12 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 10 def self.get_yaml_region ConfigurationHelper.load_yaml_file['DEV']['REGION'] end |
.load_yaml_file ⇒ Object
6 7 8 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 6 def self.load_yaml_file YAML.load_file(YAML_FILE) end |
Instance Method Details
#get_yaml_destination_cidr_block ⇒ Object
88 89 90 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 88 def get_yaml_destination_cidr_block ConfigurationHelper.load_yaml_file['DEV']['VPC']['DESTINATION_CIDR_BLOCK'] end |
#get_yaml_ec2_config ⇒ Object
92 93 94 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 92 def get_yaml_ec2_config ConfigurationHelper.load_yaml_file['DEV']['EC2'] end |
#get_yaml_ec2_instances ⇒ Object
96 97 98 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 96 def get_yaml_ec2_instances ConfigurationHelper.load_yaml_file['DEV']['EC2']['INSTANCES'] end |
#get_yaml_internet_gateway ⇒ Object
67 68 69 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 67 def get_yaml_internet_gateway ConfigurationHelper.load_yaml_file['DEV']['VPC']['INTERNET_GATEWAY'] end |
#get_yaml_stack_name ⇒ Object
14 15 16 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 14 def get_yaml_stack_name ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['STACK_NAME'] end |
#get_yaml_stack_tag_value ⇒ Object
18 19 20 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 18 def get_yaml_stack_tag_value ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TAG_VALUE'] end |
#get_yaml_subnet_cidr_block ⇒ Object
76 77 78 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 76 def get_yaml_subnet_cidr_block ConfigurationHelper.load_yaml_file['DEV']['VPC']['SUBNET_CIDR_BLOCK'] end |
#get_yaml_subnet_cidr_block_private ⇒ Object
84 85 86 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 84 def get_yaml_subnet_cidr_block_private ConfigurationHelper.load_yaml_file['DEV']['VPC']['SUBNET_CIDR_BLOCK_PRIVATE'] end |
#get_yaml_subnet_cidr_block_public ⇒ Object
80 81 82 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 80 def get_yaml_subnet_cidr_block_public ConfigurationHelper.load_yaml_file['DEV']['VPC']['SUBNET_CIDR_BLOCK_PUBLIC'] end |
#get_yaml_template_file(type) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 34 def get_yaml_template_file(type) case type when :ONE_AZ_ONE_PUB return ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_FILE_TYPE_01'] when :ONE_AZ_TWO_PUB return ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_FILE_TYPE_02'] when :ONE_AZ_ONE_PUB_PRI return ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_FILE_TYPE_03'] when :TWO_AZ_TWO_PRI return ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_FILE_TYPE_04'] when :TWO_AZ_TWO_PUB return ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_FILE_TYPE_05'] when :TWO_AZ_ONE_PUB_RPI return ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_FILE_TYPE_06'] when :TWO_AZ_TWO_PUB_PRI return ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_FILE_TYPE_07'] else return raise end end |
#get_yaml_template_path ⇒ Object
22 23 24 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 22 def get_yaml_template_path ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_PATH'] end |
#get_yaml_vpc_cidr_block ⇒ Object
72 73 74 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 72 def get_yaml_vpc_cidr_block ConfigurationHelper.load_yaml_file['DEV']['VPC']['VPC_CIDR_BLOCK'] end |
#get_yaml_vpc_route_tables ⇒ Object
63 64 65 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 63 def get_yaml_vpc_route_tables ConfigurationHelper.load_yaml_file['DEV']['VPC']['ROUTE_TABLES'] end |
#get_yaml_vpc_subnets ⇒ Object
59 60 61 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 59 def get_yaml_vpc_subnets ConfigurationHelper.load_yaml_file['DEV']['VPC']['SUBNETS'] end |
#get_yaml_vpc_tags ⇒ Object
55 56 57 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 55 def ConfigurationHelper.load_yaml_file['DEV']['VPC']['VPC_TAGS'] end |
#get_yaml_vpn_info ⇒ Object
100 101 102 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 100 def get_yaml_vpn_info ConfigurationHelper.load_yaml_file['DEV']['VPC']['VPN'] end |
#get_yaml_zas ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/etude_for_aws/helpers/configuration_helper.rb', line 26 def get_yaml_zas azs = [] azs << ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_PARAMS_AZ1'] azs << ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_PARAMS_AZ2'] azs << ConfigurationHelper.load_yaml_file['DEV']['CFM']['VPC']['TEMPLATE_PARAMS_AZ3'] azs end |