Class: DrawCloud::InternetGateway::InternetGatewayAttachment

Inherits:
Object
  • Object
show all
Defined in:
lib/draw_cloud/internet_gateway.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gateway) ⇒ InternetGatewayAttachment

Returns a new instance of InternetGatewayAttachment.



23
24
25
# File 'lib/draw_cloud/internet_gateway.rb', line 23

def initialize(gateway)
  @gateway = gateway
end

Instance Attribute Details

#gatewayObject

Returns the value of attribute gateway.



22
23
24
# File 'lib/draw_cloud/internet_gateway.rb', line 22

def gateway
  @gateway
end

Instance Method Details

#resource_nameObject



27
28
29
# File 'lib/draw_cloud/internet_gateway.rb', line 27

def resource_name
  gateway.resource_name + "Attach"
end

#to_hObject



31
32
33
34
35
36
37
38
# File 'lib/draw_cloud/internet_gateway.rb', line 31

def to_h
  { "Type" => "AWS::EC2::VPCGatewayAttachment",
    "Properties" => {
      "VpcId" => DrawCloud.ref(gateway.vpc),
      "InternetGatewayId" => DrawCloud.ref(gateway),
    },
  }
end