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’).
Attributes included from Core::Model
Instance Method Summary collapse
-
#delete ⇒ nil
Deletes this customer gateway.
-
#exists? ⇒ Boolean
Returns true if the gateway exists.
-
#initialize(customer_gateway_id, options = {}) ⇒ CustomerGateway
constructor
A new instance of CustomerGateway.
-
#vpn_connections ⇒ VPNConnectionCollection
Returns a collection of VPC connections for this gateway.
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
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, = {} @customer_gateway_id = customer_gateway_id super end |
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 |