class DrawCloud::ElasticIp

Attributes

domain[RW]
instance_id[RW]
name[RW]

Public Class Methods

new(name, options={}, &block) click to toggle source
Calls superclass method DrawCloud::Base::new
# File lib/draw_cloud/elastic_ip.rb, line 61
def initialize(name, options={}, &block)
  @name = name
  @domain = options.fetch(:domain, nil)
  @instance_id = options.fetch(:instance_id, nil)
  super(options, &block)
end

Public Instance Methods

association() click to toggle source
# File lib/draw_cloud/elastic_ip.rb, line 72
def association
  ElasticIpAssociation.new(self, instance_id, vpc)
end
elastic_ip() click to toggle source
# File lib/draw_cloud/elastic_ip.rb, line 68
def elastic_ip
  self
end
load_into_config(config) click to toggle source
Calls superclass method DrawCloud::Base#load_into_config
# File lib/draw_cloud/elastic_ip.rb, line 76
def load_into_config(config)
  config.cf_add_resource resource_name, self
  config.cf_add_resource(association.resource_name, association) if instance_id
  super(config)
end
resource_name() click to toggle source
# File lib/draw_cloud/elastic_ip.rb, line 82
def resource_name
  resource_style(name) + "EIP"
end
to_h() click to toggle source
# File lib/draw_cloud/elastic_ip.rb, line 86
def to_h
  h = {
    "Type" => "AWS::EC2::EIP",
    "Properties" => {}
  }
  h["Properties"]["Domain"] = domain unless domain.nil?
  h["Properties"]["Domain"] = "vpc" if (domain.nil? && vpc)
  add_standard_properties(h)
end