Class: CfEipAssociation

Inherits:
Object
  • Object
show all
Includes:
CfBase
Defined in:
lib/cf_factory/ec2/cf_eip_association.rb

Instance Method Summary collapse

Methods included from CfBase

#generate, #generate_ref, #get_deletion_policy, #get_name, #hash_to_string, #retrieve_attribute, #set_meta_data, #set_quotes, #set_tags

Constructor Details

#initialize(name, eip, instance, network_interface, is_vpc = false) ⇒ CfEipAssociation

TODO: network interface



6
7
8
9
10
11
# File 'lib/cf_factory/ec2/cf_eip_association.rb', line 6

def initialize(name, eip, instance, network_interface, is_vpc = false) #TODO: network interface
  @name = name
  @eip = eip      
  @instance = instance
  @is_vpc = is_vpc
end

Instance Method Details

#get_cf_attributesObject



17
18
19
# File 'lib/cf_factory/ec2/cf_eip_association.rb', line 17

def get_cf_attributes
  {}
end

#get_cf_propertiesObject



21
22
23
24
25
26
27
# File 'lib/cf_factory/ec2/cf_eip_association.rb', line 21

def get_cf_properties
  result = {}
  result["InstanceId"] = @instance.generate_ref unless @instance.nil?
  result["EIP"] = @eip.generate_ref unless @is_vpc
  result["AllocationId"] = @eip.retrieve_attribute("AllocationId") if @is_vpc
  result
end

#get_cf_typeObject



13
14
15
# File 'lib/cf_factory/ec2/cf_eip_association.rb', line 13

def get_cf_type
  "AWS::EC2::EIPAssociation"
end