Sha256: e93373f8648f5a4d8766150c7e18a72e41c5bece93aaf88102ebaa4533b15c24

Contents?: true

Size: 679 Bytes

Versions: 7

Compression:

Stored size: 679 Bytes

Contents

module Awspec::Type
  class Vpc < Base
    aws_resource Aws::EC2::Vpc

    def initialize(id)
      super
      @resource_via_client = find_vpc(id)
      @id = @resource_via_client[:vpc_id] if @resource_via_client
    end

    STATES = %w(
      available pending
    )

    STATES.each do |state|
      define_method state + '?' do
        @resource_via_client[:state] == state
      end
    end

    def has_route_table?(id)
      route_table = find_route_table(id)
      return false unless route_table
      route_table[:vpc_id] == @id
    end

    def has_network_acl?(id)
      n = find_network_acl(id)
      return false unless n
      n[:vpc_id] == @id
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
awspec-0.30.0 lib/awspec/type/vpc.rb
awspec-0.29.0 lib/awspec/type/vpc.rb
awspec-0.28.1 lib/awspec/type/vpc.rb
awspec-0.28.0 lib/awspec/type/vpc.rb
awspec-0.27.2 lib/awspec/type/vpc.rb
awspec-0.27.1 lib/awspec/type/vpc.rb
awspec-0.27.0 lib/awspec/type/vpc.rb