Sha256: 22a55c5f013874fd418c4ac5a02a54d3e3f9e238385e714221aa6f28abdf9e6a

Contents?: true

Size: 599 Bytes

Versions: 34

Compression:

Stored size: 599 Bytes

Contents

module Awspec::Type
  class NatGateway < Base
    def initialize(id)
      super
      @resource_via_client = find_nat_gateway(id)
      @id = @resource_via_client.nat_gateway_id if @resource_via_client
    end

    STATES = %w(
      pending failed available deleting deleted
    )

    STATES.each do |state|
      define_method state.tr('-', '_') + '?' do
        @resource_via_client.state == state
      end
    end

    def has_eip?(ip_address = nil)
      @resource_via_client.nat_gateway_addresses.find do |address|
        return address.public_ip == ip_address
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
awspec-0.55.0 lib/awspec/type/nat_gateway.rb
awspec-0.54.0 lib/awspec/type/nat_gateway.rb
awspec-0.52.4 lib/awspec/type/nat_gateway.rb
awspec-0.52.3 lib/awspec/type/nat_gateway.rb
awspec-0.52.2 lib/awspec/type/nat_gateway.rb
awspec-0.52.1 lib/awspec/type/nat_gateway.rb
awspec-0.52.0 lib/awspec/type/nat_gateway.rb
awspec-0.51.0 lib/awspec/type/nat_gateway.rb
awspec-0.50.0 lib/awspec/type/nat_gateway.rb
awspec-0.49.0 lib/awspec/type/nat_gateway.rb
awspec-0.48.0 lib/awspec/type/nat_gateway.rb
awspec-0.47.0 lib/awspec/type/nat_gateway.rb
awspec-0.46.0 lib/awspec/type/nat_gateway.rb
awspec-0.45.0 lib/awspec/type/nat_gateway.rb
awspec-0.44.0 lib/awspec/type/nat_gateway.rb
awspec-0.43.0 lib/awspec/type/nat_gateway.rb
awspec-0.42.0 lib/awspec/type/nat_gateway.rb
awspec-0.41.0 lib/awspec/type/nat_gateway.rb
awspec-0.40.0 lib/awspec/type/nat_gateway.rb
awspec-0.39.0 lib/awspec/type/nat_gateway.rb