aws-sdk-cloudformation 1.31.0 → 1.36.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,74 @@
8
8
  require 'aws-sdk-core/waiters'
9
9
 
10
10
  module Aws::CloudFormation
11
+ # Waiters are utility methods that poll for a particular state to occur
12
+ # on a client. Waiters can fail after a number of attempts at a polling
13
+ # interval defined for the service client.
14
+ #
15
+ # For a list of operations that can be waited for and the
16
+ # client methods called for each operation, see the table below or the
17
+ # {Client#wait_until} field documentation for the {Client}.
18
+ #
19
+ # # Invoking a Waiter
20
+ # To invoke a waiter, call #wait_until on a {Client}. The first parameter
21
+ # is the waiter name, which is specific to the service client and indicates
22
+ # which operation is being waited for. The second parameter is a hash of
23
+ # parameters that are passed to the client method called by the waiter,
24
+ # which varies according to the waiter name.
25
+ #
26
+ # # Wait Failures
27
+ # To catch errors in a waiter, use WaiterFailed,
28
+ # as shown in the following example.
29
+ #
30
+ # rescue rescue Aws::Waiters::Errors::WaiterFailed => error
31
+ # puts "failed waiting for instance running: #{error.message}
32
+ # end
33
+ #
34
+ # # Configuring a Waiter
35
+ # Each waiter has a default polling interval and a maximum number of
36
+ # attempts it will make before returning control to your program.
37
+ # To set these values, use the `max_attempts` and `delay` parameters
38
+ # in your `#wait_until` call.
39
+ # The following example waits for up to 25 seconds, polling every five seconds.
40
+ #
41
+ # client.wait_until(...) do |w|
42
+ # w.max_attempts = 5
43
+ # w.delay = 5
44
+ # end
45
+ #
46
+ # To disable wait failures, set the value of either of these parameters
47
+ # to `nil`.
48
+ #
49
+ # # Extending a Waiter
50
+ # To modify the behavior of waiters, you can register callbacks that are
51
+ # triggered before each polling attempt and before waiting.
52
+ #
53
+ # The following example implements an exponential backoff in a waiter
54
+ # by doubling the amount of time to wait on every attempt.
55
+ #
56
+ # client.wait_until(...) do |w|
57
+ # w.interval = 0 # disable normal sleep
58
+ # w.before_wait do |n, resp|
59
+ # sleep(n ** 2)
60
+ # end
61
+ # end
62
+ #
63
+ # # Available Waiters
64
+ #
65
+ # The following table lists the valid waiter names, the operations they call,
66
+ # and the default `:delay` and `:max_attempts` values.
67
+ #
68
+ # | waiter_name | params | :delay | :max_attempts |
69
+ # | -------------------------- | ----------------------------------- | -------- | ------------- |
70
+ # | change_set_create_complete | {Client#describe_change_set} | 30 | 120 |
71
+ # | stack_create_complete | {Client#describe_stacks} | 30 | 120 |
72
+ # | stack_delete_complete | {Client#describe_stacks} | 30 | 120 |
73
+ # | stack_exists | {Client#describe_stacks} | 5 | 20 |
74
+ # | stack_import_complete | {Client#describe_stacks} | 30 | 120 |
75
+ # | stack_rollback_complete | {Client#describe_stacks} | 30 | 120 |
76
+ # | stack_update_complete | {Client#describe_stacks} | 30 | 120 |
77
+ # | type_registration_complete | {Client#describe_type_registration} | 30 | 120 |
78
+ #
11
79
  module Waiters
12
80
 
13
81
  # Wait until change set status is CREATE_COMPLETE.
@@ -330,6 +398,68 @@ module Aws::CloudFormation
330
398
 
331
399
  end
332
400
 
401
+ # Wait until stack status is UPDATE_ROLLBACK_COMPLETE.
402
+ class StackRollbackComplete
403
+
404
+ # @param [Hash] options
405
+ # @option options [required, Client] :client
406
+ # @option options [Integer] :max_attempts (120)
407
+ # @option options [Integer] :delay (30)
408
+ # @option options [Proc] :before_attempt
409
+ # @option options [Proc] :before_wait
410
+ def initialize(options)
411
+ @client = options.fetch(:client)
412
+ @waiter = Aws::Waiters::Waiter.new({
413
+ max_attempts: 120,
414
+ delay: 30,
415
+ poller: Aws::Waiters::Poller.new(
416
+ operation_name: :describe_stacks,
417
+ acceptors: [
418
+ {
419
+ "argument" => "stacks[].stack_status",
420
+ "expected" => "UPDATE_ROLLBACK_COMPLETE",
421
+ "matcher" => "pathAll",
422
+ "state" => "success"
423
+ },
424
+ {
425
+ "argument" => "stacks[].stack_status",
426
+ "expected" => "UPDATE_FAILED",
427
+ "matcher" => "pathAny",
428
+ "state" => "failure"
429
+ },
430
+ {
431
+ "argument" => "stacks[].stack_status",
432
+ "expected" => "UPDATE_ROLLBACK_FAILED",
433
+ "matcher" => "pathAny",
434
+ "state" => "failure"
435
+ },
436
+ {
437
+ "argument" => "stacks[].stack_status",
438
+ "expected" => "DELETE_FAILED",
439
+ "matcher" => "pathAny",
440
+ "state" => "failure"
441
+ },
442
+ {
443
+ "expected" => "ValidationError",
444
+ "matcher" => "error",
445
+ "state" => "failure"
446
+ }
447
+ ]
448
+ )
449
+ }.merge(options))
450
+ end
451
+
452
+ # @option (see Client#describe_stacks)
453
+ # @return (see Client#describe_stacks)
454
+ def wait(params = {})
455
+ @waiter.wait(client: @client, params: params)
456
+ end
457
+
458
+ # @api private
459
+ attr_reader :waiter
460
+
461
+ end
462
+
333
463
  # Wait until stack status is UPDATE_COMPLETE.
334
464
  class StackUpdateComplete
335
465
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-cloudformation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.31.0
4
+ version: 1.36.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-09 00:00:00.000000000 Z
11
+ date: 2020-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-core
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  requirements: []
88
88
  rubyforge_project:
89
- rubygems_version: 2.5.2.3
89
+ rubygems_version: 2.7.6.2
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: AWS SDK for Ruby - AWS CloudFormation