Class: EC2::Configuration
- Inherits:
-
Object
- Object
- EC2::Configuration
- Includes:
- ConfigurationHelper
- Defined in:
- lib/etude_for_aws/ec2/configuration.rb
Direct Known Subclasses
Constant Summary
Constants included from ConfigurationHelper
ConfigurationHelper::YAML_FILE
Instance Attribute Summary collapse
-
#az ⇒ Object
Returns the value of attribute az.
-
#image_id ⇒ Object
readonly
Returns the value of attribute image_id.
-
#instance_tags ⇒ Object
Returns the value of attribute instance_tags.
-
#instance_tags_private ⇒ Object
readonly
Returns the value of attribute instance_tags_private.
-
#instance_tags_public ⇒ Object
readonly
Returns the value of attribute instance_tags_public.
-
#instance_type ⇒ Object
readonly
Returns the value of attribute instance_type.
-
#key_pair_name ⇒ Object
readonly
Returns the value of attribute key_pair_name.
-
#key_pair_path ⇒ Object
readonly
Returns the value of attribute key_pair_path.
-
#max_count ⇒ Object
readonly
Returns the value of attribute max_count.
-
#min_count ⇒ Object
readonly
Returns the value of attribute min_count.
-
#security_group_description ⇒ Object
readonly
Returns the value of attribute security_group_description.
-
#security_group_name ⇒ Object
readonly
Returns the value of attribute security_group_name.
-
#stub ⇒ Object
readonly
Returns the value of attribute stub.
-
#subnet_id ⇒ Object
Returns the value of attribute subnet_id.
-
#vpc_id ⇒ Object
Returns the value of attribute vpc_id.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #stub? ⇒ Boolean
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.
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 53 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 22 def initialize ec2_config = get_yaml_ec2_config @security_group_name = ec2_config['SECURITY_GROUP_NAME'] @security_group_description = ec2_config['SECURITY_GROUP_DESCRIPTION'] @key_pair_name = ec2_config['KEY_PAIR_NAME'] @key_pair_path = ec2_config['KEY_PAIR_PATH'] @image_id = ec2_config['IMAGE_ID'] @instance_type = ec2_config['INSTANCE_TYPE'] @min_count = ec2_config['MIN_COUNT'].to_i @max_count = ec2_config['MAX_COUNT'].to_i = group_value = ['GROUP']['VALUE'] instances = get_yaml_ec2_instances = [] unless instances['PUBLIC'].nil? instances['PUBLIC'].each do |v| name_value = v['CONFIG']['INSTANCE_TAGS'].first['NAME']['VALUE'] << [{key: 'Name', value: name_value}, {key: 'Group', value: group_value}] end end = [] unless instances['PRIVATE'].nil? instances['PRIVATE'].each do |v| name_value = v['CONFIG']['INSTANCE_TAGS'].first['NAME']['VALUE'] << [{key: 'Name', value: name_value}, {key: 'Group', value: group_value}] end end = [] @stub = false end |
Instance Attribute Details
#az ⇒ Object
Returns the value of attribute az.
5 6 7 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 5 def az @az end |
#image_id ⇒ Object (readonly)
Returns the value of attribute image_id.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def image_id @image_id end |
#instance_tags ⇒ Object
Returns the value of attribute instance_tags.
5 6 7 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 5 def end |
#instance_tags_private ⇒ Object (readonly)
Returns the value of attribute instance_tags_private.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def end |
#instance_tags_public ⇒ Object (readonly)
Returns the value of attribute instance_tags_public.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def end |
#instance_type ⇒ Object (readonly)
Returns the value of attribute instance_type.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def instance_type @instance_type end |
#key_pair_name ⇒ Object (readonly)
Returns the value of attribute key_pair_name.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def key_pair_name @key_pair_name end |
#key_pair_path ⇒ Object (readonly)
Returns the value of attribute key_pair_path.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def key_pair_path @key_pair_path end |
#max_count ⇒ Object (readonly)
Returns the value of attribute max_count.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def max_count @max_count end |
#min_count ⇒ Object (readonly)
Returns the value of attribute min_count.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def min_count @min_count end |
#security_group_description ⇒ Object (readonly)
Returns the value of attribute security_group_description.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def security_group_description @security_group_description end |
#security_group_name ⇒ Object (readonly)
Returns the value of attribute security_group_name.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def security_group_name @security_group_name end |
#stub ⇒ Object (readonly)
Returns the value of attribute stub.
10 11 12 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 10 def stub @stub end |
#subnet_id ⇒ Object
Returns the value of attribute subnet_id.
5 6 7 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 5 def subnet_id @subnet_id end |
#vpc_id ⇒ Object
Returns the value of attribute vpc_id.
5 6 7 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 5 def vpc_id @vpc_id end |
Instance Method Details
#stub? ⇒ Boolean
55 56 57 |
# File 'lib/etude_for_aws/ec2/configuration.rb', line 55 def stub? @stub end |