Class: CfFactory::CfNetworkInterface

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

Instance Method Summary collapse

Methods included from CfBase

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

Constructor Details

#initialize(name, subnet, options = {}) ⇒ CfNetworkInterface

Returns a new instance of CfNetworkInterface.



7
8
9
10
11
12
13
14
15
# File 'lib/cf_factory/ec2/cf_network_interface.rb', line 7

def initialize(name, subnet, options = {})
  @name = name
  @subnet = subnet
  #
  @private_ip = options[:private_ip]
  @description = options[:description]
  @security_groups = options[:security_groups]
  @source_dst_check = options[:source_dest_check]
end

Instance Method Details

#get_cf_attributesObject



25
26
27
# File 'lib/cf_factory/ec2/cf_network_interface.rb', line 25

def get_cf_attributes
  {}
end

#get_cf_propertiesObject



29
30
31
32
33
34
35
36
37
# File 'lib/cf_factory/ec2/cf_network_interface.rb', line 29

def get_cf_properties
  result = {}
  result["Description"] = @description unless @description.nil?      
  result["SourceDestCheck"] = @source_dest_check unless @source_dst_check.nil?
  result["GroupSet"] = CfHelper.generate_ref_array(@security_groups) unless @security_groups.nil?
  result["SubnetId"] = @subnet.generate_ref unless @subnet.nil?
  result["PrivateIpAddress"] = @private_ip unless @private_ip.nil?
  result
end

#get_cf_typeObject



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

def get_cf_type
  "AWS::EC2::NetworkInterface"
end

#set_tags(tag_list) ⇒ Object



21
22
23
# File 'lib/cf_factory/ec2/cf_network_interface.rb', line 21

def set_tags(tag_list)
  @tag_list = tag_list 
end