Class: AWS::EC2::CustomerGateway

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TaggedItem

#add_tag, #clear_tags, #tags

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