Sha256: ca98792df26e3fc47241533983d009d7412519af7020baced01183dfa83599b8
Contents?: true
Size: 1.14 KB
Versions: 96
Compression:
Stored size: 1.14 KB
Contents
module Awspec::Helper module Finder module Subnet 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 def select_subnet_by_vpc_id(vpc_id) res = ec2_client.describe_subnets({ filters: [{ name: 'vpc-id', values: [vpc_id] }] }) res.subnets end end end end
Version data entries
96 entries across 96 versions & 4 rubygems