« blib/lib/VM/EC2/VPC/RouteTable/Association.pm
↑ Summary
blib/lib/VM/EC2/VPC/VpnGateway/Attachment.pm »
| 1 | package VM::EC2::VPC::VpnConnection; | ||
| 2 | |||
| 3 | =head1 NAME | ||
| 4 | |||
| 5 | VM::EC2::VPC::VpnConnection - VPC VPN connection | ||
| 6 | |||
| 7 | =head1 SYNOPSIS | ||
| 8 | |||
| 9 | use VM::EC2; | ||
| 10 | |||
| 11 | my $ec2 = VM::EC2->new(...); | ||
| 12 | my $vpn = $ec2->describe_vpn_connections(-vpn_connection_id=>'vpn-12345678'); | ||
| 13 | my $state = $vpn->state; | ||
| 14 | my $vpn_gateway = $vpn->vpn_gateway; | ||
| 15 | my $customer_gateway = $vpn->customer_gateway; | ||
| 16 | |||
| 17 | =head1 DESCRIPTION | ||
| 18 | |||
| 19 | This object represents an Amazon EC2 VPC VPN connection, and is returned by | ||
| 20 | VM::EC2->describe_vpn_connections() | ||
| 21 | |||
| 22 | =head1 METHODS | ||
| 23 | |||
| 24 | These object methods are supported: | ||
| 25 | |||
| 26 | vpnConnectionId -- The ID of the VPN connection. | ||
| 27 | state -- The current state of the VPN connection. | ||
| 28 | Valid values: pending | available | deleting | deleted | ||
| 29 | customerGatewayConfiguration -- Configuration information for the VPN connection's | ||
| 30 | customer gateway (in the native XML format). This | ||
| 31 | element is always present in the CreateVpnConnection | ||
| 32 | response; however, it's present in the | ||
| 33 | DescribeVpnConnections response only if the VPN | ||
| 34 | connection is in the pending or available state. | ||
| 35 | type -- The type of VPN connection (ipsec.1) | ||
| 36 | customerGatewayId -- ID of the customer gateway at your end of the VPN | ||
| 37 | connection. | ||
| 38 | vpnGatewayId -- ID of the virtual private gateway at the VPC end of | ||
| 39 | the VPN connection. | ||
| 40 | tagSet -- Tags assigned to the resource. | ||
| 41 | vgwTelemetry -- Information about the virtual private gateway. | ||
| 42 | vpn_telemetry -- Alias for vgwTelemetry | ||
| 43 | |||
| 44 | The following convenience methods are supported: | ||
| 45 | |||
| 46 | vpn_gateway -- Returns a L<VM::EC2::VPC::VpnGateway> object | ||
| 47 | |||
| 48 | customer_gateway -- Returns a L<VM::EC2::VPC::CustomerGateway> object | ||
| 49 | |||
| 50 | The object also supports the tags() method described in | ||
| 51 | L<VM::EC2::Generic>: | ||
| 52 | |||
| 53 | =head1 STRING OVERLOADING | ||
| 54 | |||
| 55 | When used in a string context, this object will interpolate the | ||
| 56 | vpnConnectionId. | ||
| 57 | |||
| 58 | =head1 SEE ALSO | ||
| 59 | |||
| 60 | L<VM::EC2> | ||
| 61 | L<VM::EC2::Generic> | ||
| 62 | L<VM::EC2::Tag> | ||
| 63 | L<VM::EC2::VPC> | ||
| 64 | L<VM::EC2::VPC::CustomerGateway> | ||
| 65 | L<VM::EC2::VPC::VpnGateway> | ||
| 66 | |||
| 67 | =head1 AUTHOR | ||
| 68 | |||
| 69 | Lance Kinley E<lt>lkinley@loyaltymethods.comE<gt>. | ||
| 70 | |||
| 71 | Copyright (c) 2012 Loyalty Methods, Inc. | ||
| 72 | |||
| 73 | This package and its accompanying libraries is free software; you can | ||
| 74 | redistribute it and/or modify it under the terms of the GPL (either | ||
| 75 | version 1, or at your option, any later version) or the Artistic | ||
| 76 | License 2.0. Refer to LICENSE for the full license text. In addition, | ||
| 77 | please see DISCLAIMER.txt for disclaimers of warranty. | ||
| 78 | |||
| 79 | =cut | ||
| 80 | |||
| 81 | use strict; | ||
| 82 | use base 'VM::EC2::Generic'; | ||
| 83 | use VM::EC2::VPC::VpnTunnelTelemetry; | ||
| 84 | use Carp 'croak'; | ||
| 85 | |||
| 86 | sub primary_id { shift->vpnConnectionId } | ||
| 87 | |||
| 88 | sub valid_fields { | ||
| 89 | my $self = shift; | ||
| 90 | return qw(vpnConnectionId state customerGatewayConfiguration type | ||
| 91 | customerGatewayId vpnGatewayId tagSet vgwTelemetry); | ||
| 92 | } | ||
| 93 | |||
| 94 | sub vgwTelemetry { | ||
| 95 | my $self = shift; | ||
| 96 | my $telemetry = $self->SUPER::vgwTelemetry; | ||
| 97 | return VM::EC2::VPC::VpnTunnelTelemetry->new($telemetry,$self->aws); | ||
| 98 | } | ||
| 99 | |||
| 100 | sub vpn_telemetry { shift->vgwTelemetry } | ||
| 101 | |||
| 102 | sub vpn_gateway { | ||
| 103 | my $self = shift; | ||
| 104 | my $vpn_gw = $self->vpnGatewayId; | ||
| 105 | return $self->aws->describe_vpn_gateways($vpn_gw); | ||
| 106 | } | ||
| 107 | |||
| 108 | sub customer_gateway { | ||
| 109 | my $self = shift; | ||
| 110 | my $cust_gw = $self->customerGatewayId; | ||
| 111 | return $self->aws->describe_customer_gateways($cust_gw); | ||
| 112 | } | ||
| 113 | |||
| 114 | 1; |