class DrawCloud::NetworkInterface

Attributes

description[RW]
group_set[RW]
name[RW]
private_ip_address[RW]
security_groups[RW]
security_groups=[RW]
source_dest_check[RW]
subnet[RW]
subnet=[RW]
subnet_id[RW]
tags[RW]

Public Class Methods

new(name, options={}, &block) click to toggle source
Calls superclass method DrawCloud::Base::new
# File lib/draw_cloud/network_interface.rb, line 26
def initialize(name, options={}, &block)
  @name = name
  @tags = {}
  super(options, &block)
end

Public Instance Methods

default_tags() click to toggle source
# File lib/draw_cloud/network_interface.rb, line 49
def default_tags
  {"Name" => resource_style(name)}
end
elastic_ip=(eip) click to toggle source
# File lib/draw_cloud/network_interface.rb, line 45
def elastic_ip=(eip)
  eip.instance_id = self
end
load_into_config(config) click to toggle source
Calls superclass method DrawCloud::Base#load_into_config
# File lib/draw_cloud/network_interface.rb, line 36
def load_into_config(config)
  config.cf_add_resource resource_name, self
  super(config)
end
network_interface() click to toggle source
# File lib/draw_cloud/network_interface.rb, line 32
def network_interface
  self
end
resource_name() click to toggle source
# File lib/draw_cloud/network_interface.rb, line 41
def resource_name
  resource_style(name) + "ElasticNetworkInterface"
end
to_h() click to toggle source
# File lib/draw_cloud/network_interface.rb, line 53
def to_h
  h = {
    "Type" => "AWS::EC2::NetworkInterface",
    "Properties" => {
      "SubnetId" => DrawCloud.ref(subnet_id)
    }
  }
  p = h["Properties"]
  p["Description"] = description unless description.nil?
  p["GroupSet"] = group_set.collect {|g| DrawCloud.ref(g)} unless (group_set.nil? || group_set.empty?)
  p["PrivateIpAddress"] = private_ip_address unless private_ip_address.nil?
  p["SourceDestCheck"] = source_dest_check unless source_dest_check.nil?
  all_tags = default_tags.merge(tags)
  p["Tags"] = hash_to_tag_array(all_tags) unless all_tags.empty?
  add_standard_properties(h)
end