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

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

Instance Attribute Summary collapse

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)


784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
# File 'lib/aws-sdk-ec2/waiters.rb', line 784

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 Attribute Details

#waiterObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



815
816
817
# File 'lib/aws-sdk-ec2/waiters.rb', line 815

def waiter
  @waiter
end

Instance Method Details

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

Returns a response object which responds to the following methods:

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`:&lt;key&gt; - 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 of 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`.

  • :include_public_key (Boolean)

    If ‘true`, the public key material is included in the response.

    Default: ‘false`

Returns:



810
811
812
# File 'lib/aws-sdk-ec2/waiters.rb', line 810

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