Sha256: 8f9d38a6b0399b9b00e7a5da3cd8f76358398cbd9151f262a80c23524ed2ff3d

Contents?: true

Size: 885 Bytes

Versions: 79

Compression:

Stored size: 885 Bytes

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] }]
                                          })
        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

79 entries across 79 versions & 1 rubygems

Version Path
awspec-0.79.2 lib/awspec/helper/finder/subnet.rb
awspec-0.79.1 lib/awspec/helper/finder/subnet.rb
awspec-0.79.0 lib/awspec/helper/finder/subnet.rb
awspec-0.78.1 lib/awspec/helper/finder/subnet.rb
awspec-0.77.1 lib/awspec/helper/finder/subnet.rb
awspec-0.77.0 lib/awspec/helper/finder/subnet.rb
awspec-0.76.1 lib/awspec/helper/finder/subnet.rb
awspec-0.76.0 lib/awspec/helper/finder/subnet.rb
awspec-0.75.2 lib/awspec/helper/finder/subnet.rb
awspec-0.75.1 lib/awspec/helper/finder/subnet.rb
awspec-0.75.0 lib/awspec/helper/finder/subnet.rb
awspec-0.74.1 lib/awspec/helper/finder/subnet.rb
awspec-0.74.0 lib/awspec/helper/finder/subnet.rb
awspec-0.73.2 lib/awspec/helper/finder/subnet.rb
awspec-0.73.1 lib/awspec/helper/finder/subnet.rb
awspec-0.73.0 lib/awspec/helper/finder/subnet.rb
awspec-0.72.0 lib/awspec/helper/finder/subnet.rb
awspec-0.71.0 lib/awspec/helper/finder/subnet.rb
awspec-0.70.0 lib/awspec/helper/finder/subnet.rb
awspec-0.69.1 lib/awspec/helper/finder/subnet.rb