Sha256: 999993c2a8eb8be3086a04c92ebe1f60c2e966d2d6be24cfe07e7a6065f07df1

Contents?: true

Size: 688 Bytes

Versions: 34

Compression:

Stored size: 688 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

34 entries across 34 versions & 1 rubygems

Version Path
awspec-0.38.0 lib/awspec/type/vpc.rb
awspec-0.37.8 lib/awspec/type/vpc.rb
awspec-0.37.7 lib/awspec/type/vpc.rb
awspec-0.37.6 lib/awspec/type/vpc.rb
awspec-0.37.5 lib/awspec/type/vpc.rb
awspec-0.37.4 lib/awspec/type/vpc.rb
awspec-0.37.3 lib/awspec/type/vpc.rb
awspec-0.37.2 lib/awspec/type/vpc.rb
awspec-0.37.1 lib/awspec/type/vpc.rb
awspec-0.37.0 lib/awspec/type/vpc.rb
awspec-0.36.1 lib/awspec/type/vpc.rb
awspec-0.36.0 lib/awspec/type/vpc.rb
awspec-0.35.0 lib/awspec/type/vpc.rb
awspec-0.34.0 lib/awspec/type/vpc.rb