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.55.0 lib/awspec/type/vpc.rb
awspec-0.54.0 lib/awspec/type/vpc.rb
awspec-0.52.4 lib/awspec/type/vpc.rb
awspec-0.52.3 lib/awspec/type/vpc.rb
awspec-0.52.2 lib/awspec/type/vpc.rb
awspec-0.52.1 lib/awspec/type/vpc.rb
awspec-0.52.0 lib/awspec/type/vpc.rb
awspec-0.51.0 lib/awspec/type/vpc.rb
awspec-0.50.0 lib/awspec/type/vpc.rb
awspec-0.49.0 lib/awspec/type/vpc.rb
awspec-0.48.0 lib/awspec/type/vpc.rb
awspec-0.47.0 lib/awspec/type/vpc.rb
awspec-0.46.0 lib/awspec/type/vpc.rb
awspec-0.45.0 lib/awspec/type/vpc.rb
awspec-0.44.0 lib/awspec/type/vpc.rb
awspec-0.43.0 lib/awspec/type/vpc.rb
awspec-0.42.0 lib/awspec/type/vpc.rb
awspec-0.41.0 lib/awspec/type/vpc.rb
awspec-0.40.0 lib/awspec/type/vpc.rb
awspec-0.39.0 lib/awspec/type/vpc.rb