Class: AWS::EC2::CustomerGateway
- Inherits:
-
Resource
- Object
- Core::Resource
- Resource
- AWS::EC2::CustomerGateway
- Includes:
- TaggedItem
- Defined in:
- lib/aws/ec2/customer_gateway.rb
Instance Attribute Summary collapse
-
#bgp_asn ⇒ Integer
readonly
The customer gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).
- #customer_gateway_id ⇒ String (also: #id) readonly
-
#ip_address ⇒ String
readonly
The Internet-routable IP address of the customer gateway’s outside interface.
-
#state ⇒ Symbol
readonly
Returns the gateway state (e.g. :pending, :available, :deleting, :deleted).
-
#type ⇒ String
readonly
The type of VPN connection the customer gateway supports (e.g. ‘ipsec.1’).
Instance Method Summary collapse
-
#delete ⇒ nil
Deletes this customer gateway.
-
#exists? ⇒ Boolean
Returns true if the gateway exists.
-
#vpn_connections ⇒ VPNConnectionCollection
Returns a collection of VPC connections for this gateway.
Methods included from TaggedItem
Instance Attribute Details
#bgp_asn ⇒ Integer (readonly)
The customer gateway’s Border Gateway Protocol (BGP) Autonomous System Number (ASN).
29 30 31 |
# File 'lib/aws/ec2/customer_gateway.rb', line 29 def bgp_asn @bgp_asn end |
#customer_gateway_id ⇒ String (readonly) Also known as: id
40 41 42 |
# File 'lib/aws/ec2/customer_gateway.rb', line 40 def customer_gateway_id @customer_gateway_id end |
#ip_address ⇒ String (readonly)
The Internet-routable IP address of the customer gateway’s outside interface.
29 30 31 |
# File 'lib/aws/ec2/customer_gateway.rb', line 29 def ip_address @ip_address end |
#state ⇒ Symbol (readonly)
Returns the gateway state (e.g. :pending, :available, :deleting, :deleted)
29 30 31 |
# File 'lib/aws/ec2/customer_gateway.rb', line 29 def state @state end |
#type ⇒ String (readonly)
The type of VPN connection the customer gateway supports (e.g. ‘ipsec.1’).
29 30 31 |
# File 'lib/aws/ec2/customer_gateway.rb', line 29 def type @type end |
Instance Method Details
#delete ⇒ nil
Deletes this customer gateway.
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.
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_connections ⇒ VPNConnectionCollection
Returns a collection of VPC connections for this gateway.
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 |