Method: Awspec::Helper::Finder::Ec2#find_vpn_connection

Defined in:
lib/awspec/helper/finder/ec2.rb

#find_vpn_connection(vpn_connection_id) ⇒ Object



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/awspec/helper/finder/ec2.rb', line 90

def find_vpn_connection(vpn_connection_id)
  res = ec2_client.describe_vpn_connections({
                                              filters: [
                                                {
                                                  name: 'vpn-connection-id',
                                                  values: [vpn_connection_id]
                                                }
                                              ]
                                            })
  resource = res.vpn_connections.single_resource(vpn_connection_id)
  return resource if resource
  res = ec2_client.describe_vpn_connections({
                                              filters: [
                                                {
                                                  name: 'tag:Name',
                                                  values: [vpn_connection_id]
                                                }
                                              ]
                                            })
  res.vpn_connections.single_resource(vpn_connection_id)
end