Class: AWS::EC2::CustomerGateway

Inherits:
Resource show all
Includes:
TaggedItem
Defined in:
lib/aws/ec2/customer_gateway.rb

Instance Attribute Summary collapse

Attributes included from Core::Model

#config

Instance Method Summary collapse

Methods included from TaggedItem

#add_tag, #cached_tags, #clear_tags, #tagging_resource_type, #tags

Methods inherited from Core::Resource

attribute_providers, attribute_providers_for, attributes, #attributes_from_response, define_attribute_type, #eql?, #inspect, new_from

Methods included from Core::Cacheable

included, #retrieve_attribute

Methods included from Core::Model

#client, #config_prefix, #inspect

Constructor Details

#initialize(customer_gateway_id, options = {}) ⇒ CustomerGateway

Returns a new instance of CustomerGateway.



34
35
36
37
# File 'lib/aws/ec2/customer_gateway.rb', line 34

def initialize customer_gateway_id, options = {}
  @customer_gateway_id = customer_gateway_id
  super
end

Instance Attribute Details

#bgp_asnInteger (readonly)

The customer gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).

Returns:

  • (Integer)

    the current value of bgp_asn



29
30
31
# File 'lib/aws/ec2/customer_gateway.rb', line 29

def bgp_asn
  @bgp_asn
end

#customer_gateway_idString (readonly) Also known as: id

Returns:

  • (String)


40
41
42
# File 'lib/aws/ec2/customer_gateway.rb', line 40

def customer_gateway_id
  @customer_gateway_id
end

#ip_addressString (readonly)

The Internet-routable IP address of the customer gateway’s outside interface.

Returns:

  • (String)

    the current value of ip_address



29
30
31
# File 'lib/aws/ec2/customer_gateway.rb', line 29

def ip_address
  @ip_address
end

#stateSymbol (readonly)

Returns the gateway state (e.g. :pending, :available, :deleting, :deleted)

Returns:

  • (Symbol)

    the current value of state



29
30
31
# File 'lib/aws/ec2/customer_gateway.rb', line 29

def state
  @state
end

#typeString (readonly)

The type of VPN connection the customer gateway supports (e.g. ‘ipsec.1’).

Returns:

  • (String)

    the current value of type



29
30
31
# File 'lib/aws/ec2/customer_gateway.rb', line 29

def type
  @type
end

Instance Method Details

#deletenil

Deletes this customer gateway.

Returns:

  • (nil)


71
72
73
74
75
76
# File 'lib/aws/ec2/customer_gateway.rb', line 71

def delete
  client_opts = {}
  client_opts[:customer_gateway_id] = customer_gateway_id
  client.delete_customer_gateway(client_opts)
  nil
end

#exists?Boolean

Returns true if the gateway exists.

Returns:

  • (Boolean)

    Returns true if the gateway exists.



79
80
81
82
83
84
85
86
# File 'lib/aws/ec2/customer_gateway.rb', line 79

def exists?
  begin
    client.describe_customer_gateways(:customer_gateway_ids => [id])
    true
  rescue Errors::InvalidCustomerGatewayID::NotFound
    false
  end
end

#vpn_connectionsVPNConnectionCollection

Returns a collection of VPC connections for this gateway.

Returns:



64
65
66
67
# File 'lib/aws/ec2/customer_gateway.rb', line 64

def vpn_connections
  connections = VPNConnectionCollection.new(:config => config)
  connections.filter('customer-gateway-id', id)
end