Sha256: 12f31eadf30f6df46c581e2a6f49aa9fb886bd3c89202c17edcaf169d0cc2f3b

Contents?: true

Size: 264 Bytes

Versions: 6

Compression:

Stored size: 264 Bytes

Contents

require 'aws-sdk-ec2'

module AmiSpec
  class AwsDefaultVpc
    def self.find_subnet(ec2: Aws::EC2::Resource.new)
      default_vpc = ec2.vpcs(filters: [{name: 'isDefault', values: ['true']}]).first
      default_vpc && default_vpc.subnets.first
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ami_spec-1.8.2 lib/ami_spec/aws_default_vpc.rb
ami_spec-1.8.1 lib/ami_spec/aws_default_vpc.rb
ami_spec-1.8.0 lib/ami_spec/aws_default_vpc.rb
ami_spec-1.7.0 lib/ami_spec/aws_default_vpc.rb
ami_spec-1.6.0 lib/ami_spec/aws_default_vpc.rb
ami_spec-1.5.0 lib/ami_spec/aws_default_vpc.rb