Class: CfFactory::CfAttachGateway

Inherits:
Object
  • Object
show all
Includes:
CfBase
Defined in:
lib/cf_factory/vpc/cf_attach_gateway.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, #set_tags

Constructor Details

#initialize(name, vpc = nil, internet_gateway = nil, vpn_gateway = nil) ⇒ CfAttachGateway

Returns a new instance of CfAttachGateway.



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

def initialize(name, vpc = nil, internet_gateway = nil, vpn_gateway = nil)
  @name = name
  @vpc = vpc
  @internet_gateway = internet_gateway
  @vpn_gateway = vpn_gateway 
end

Instance Method Details

#get_cf_attributesObject



17
18
19
# File 'lib/cf_factory/vpc/cf_attach_gateway.rb', line 17

def get_cf_attributes
  {}
end

#get_cf_propertiesObject



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

def get_cf_properties
  result = {}
  result["VpcId"] = @vpc.generate_ref
  result["InternetGatewayId"] = @internet_gateway.generate_ref unless @internet_gateway.nil?
  result["VpnGatewayId"] = @vpn_gateway.generate_ref unless @vpn_gateway.nil?
  result
end

#get_cf_typeObject



13
14
15
# File 'lib/cf_factory/vpc/cf_attach_gateway.rb', line 13

def get_cf_type
  "AWS::EC2::VPCGatewayAttachment"
end