4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/awspec/helper/finder/subnet.rb', line 4
def find_subnet(subnet_id)
res = ec2_client.describe_subnets({
filters: [{ name: 'subnet-id', values: [subnet_id] }]
})
resource = res.subnets.single_resource(subnet_id)
return resource if resource
res = ec2_client.describe_subnets({
filters: [{ name: 'tag:Name', values: [subnet_id] }]
})
resource = res.subnets.single_resource(subnet_id)
return resource if resource
res = ec2_client.describe_subnets({
filters: [{ name: 'cidrBlock', values: [subnet_id] }]
})
res.subnets.single_resource(subnet_id)
end
|