class EC2::Configuration

Attributes

az[RW]
image_id[R]
instance_tags[RW]
instance_tags_private[R]
instance_tags_public[R]
instance_type[R]
key_pair_name[R]
key_pair_path[R]
max_count[R]
min_count[R]
security_group_description[R]
security_group_name[R]
stub[R]
subnet_id[RW]
vpc_id[RW]

Public Class Methods

new() click to toggle source
# 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

  vpc_tags = get_yaml_vpc_tags
  group_value = vpc_tags['GROUP']['VALUE']
  instances = get_yaml_ec2_instances
  @instance_tags_public = []
  unless instances['PUBLIC'].nil?
    instances['PUBLIC'].each do |v|
      name_value = v['CONFIG']['INSTANCE_TAGS'].first['NAME']['VALUE']
      @instance_tags_public << [{key: 'Name', value: name_value}, {key: 'Group', value: group_value}]
    end
  end
  @instance_tags_private = []
  unless instances['PRIVATE'].nil?
    instances['PRIVATE'].each do |v|
      name_value = v['CONFIG']['INSTANCE_TAGS'].first['NAME']['VALUE']
      @instance_tags_private << [{key: 'Name', value: name_value}, {key: 'Group', value: group_value}]
    end
  end
  @instance_tags = []

  @stub = false
end

Public Instance Methods

stub?() click to toggle source
# File lib/etude_for_aws/ec2/configuration.rb, line 55
def stub?
  @stub
end