Class: Aws::EC2::Waiters::KeyPairExists

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-ec2/lib/aws-sdk-ec2/waiters.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ KeyPairExists

Returns a new instance of KeyPairExists.

Parameters:

  • options (Hash)

Options Hash (options):

  • :client (required, Client)
  • :max_attempts (Integer) — default: 6
  • :delay (Integer) — default: 5
  • :before_attempt (Proc)
  • :before_wait (Proc)


737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/waiters.rb', line 737

def initialize(options)
  @client = options.fetch(:client)
  @waiter = Aws::Waiters::Waiter.new({
    max_attempts: 6,
    delay: 5,
    poller: Aws::Waiters::Poller.new(
      operation_name: :describe_key_pairs,
      acceptors: [
        {
          "expected" => true,
          "matcher" => "path",
          "state" => "success",
          "argument" => "length(key_pairs[].key_name) > `0`"
        },
        {
          "expected" => "InvalidKeyPair.NotFound",
          "matcher" => "error",
          "state" => "retry"
        }
      ]
    )
  }.merge(options))
end

Instance Method Details

#wait(params = {}) ⇒ Types::DescribeKeyPairsResult

Returns a response object which responds to the following methods:

Parameters:

  • params (Hash) (defaults to: {})

    a customizable set of options

Options Hash (params):

  • :filters (Array<Types::Filter>)

    The filters.

    • key-pair-id - The ID of the key pair.

    • fingerprint - The fingerprint of the key pair.

    • key-name - The name of the key pair.

    • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

    • tag:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

  • :key_names (Array<String>)

    The key pair names.

    Default: Describes all your key pairs.

  • :key_pair_ids (Array<String>)

    The IDs of the key pairs.

  • :dry_run (Boolean)

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Returns:



763
764
765
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/waiters.rb', line 763

def wait(params = {})
  @waiter.wait(client: @client, params: params)
end