Sha256: 8e4dc42e74088c58e6c4b52f817b9a3c471660a28ed662ea1b9fde0a19cee1b6

Contents?: true

Size: 696 Bytes

Versions: 3

Compression:

Stored size: 696 Bytes

Contents

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

    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

3 entries across 3 versions & 1 rubygems

Version Path
awspec-0.33.0 lib/awspec/type/vpc.rb
awspec-0.32.0 lib/awspec/type/vpc.rb
awspec-0.31.0 lib/awspec/type/vpc.rb