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.43.0 lib/awspec/helper/finder/subnet.rb
awspec-0.42.0 lib/awspec/helper/finder/subnet.rb
awspec-0.41.0 lib/awspec/helper/finder/subnet.rb
awspec-0.40.0 lib/awspec/helper/finder/subnet.rb
awspec-0.39.0 lib/awspec/helper/finder/subnet.rb
awspec-0.38.0 lib/awspec/helper/finder/subnet.rb
awspec-0.37.8 lib/awspec/helper/finder/subnet.rb
awspec-0.37.7 lib/awspec/helper/finder/subnet.rb
awspec-0.37.6 lib/awspec/helper/finder/subnet.rb
awspec-0.37.5 lib/awspec/helper/finder/subnet.rb
awspec-0.37.4 lib/awspec/helper/finder/subnet.rb
awspec-0.37.3 lib/awspec/helper/finder/subnet.rb
awspec-0.37.2 lib/awspec/helper/finder/subnet.rb
awspec-0.37.1 lib/awspec/helper/finder/subnet.rb
awspec-0.37.0 lib/awspec/helper/finder/subnet.rb
awspec-0.36.1 lib/awspec/helper/finder/subnet.rb
awspec-0.36.0 lib/awspec/helper/finder/subnet.rb
awspec-0.35.0 lib/awspec/helper/finder/subnet.rb
awspec-0.34.0 lib/awspec/helper/finder/subnet.rb