1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package cloudformation
4
5import (
6	"time"
7
8	"github.com/aws/aws-sdk-go/aws"
9	"github.com/aws/aws-sdk-go/aws/request"
10)
11
12// WaitUntilChangeSetCreateComplete uses the AWS CloudFormation API operation
13// DescribeChangeSet to wait for a condition to be met before returning.
14// If the condition is not met within the max attempt window, an error will
15// be returned.
16func (c *CloudFormation) WaitUntilChangeSetCreateComplete(input *DescribeChangeSetInput) error {
17	return c.WaitUntilChangeSetCreateCompleteWithContext(aws.BackgroundContext(), input)
18}
19
20// WaitUntilChangeSetCreateCompleteWithContext is an extended version of WaitUntilChangeSetCreateComplete.
21// With the support for passing in a context and options to configure the
22// Waiter and the underlying request options.
23//
24// The context must be non-nil and will be used for request cancellation. If
25// the context is nil a panic will occur. In the future the SDK may create
26// sub-contexts for http.Requests. See https://golang.org/pkg/context/
27// for more information on using Contexts.
28func (c *CloudFormation) WaitUntilChangeSetCreateCompleteWithContext(ctx aws.Context, input *DescribeChangeSetInput, opts ...request.WaiterOption) error {
29	w := request.Waiter{
30		Name:        "WaitUntilChangeSetCreateComplete",
31		MaxAttempts: 120,
32		Delay:       request.ConstantWaiterDelay(30 * time.Second),
33		Acceptors: []request.WaiterAcceptor{
34			{
35				State:   request.SuccessWaiterState,
36				Matcher: request.PathWaiterMatch, Argument: "Status",
37				Expected: "CREATE_COMPLETE",
38			},
39			{
40				State:   request.FailureWaiterState,
41				Matcher: request.PathWaiterMatch, Argument: "Status",
42				Expected: "FAILED",
43			},
44			{
45				State:    request.FailureWaiterState,
46				Matcher:  request.ErrorWaiterMatch,
47				Expected: "ValidationError",
48			},
49		},
50		Logger: c.Config.Logger,
51		NewRequest: func(opts []request.Option) (*request.Request, error) {
52			var inCpy *DescribeChangeSetInput
53			if input != nil {
54				tmp := *input
55				inCpy = &tmp
56			}
57			req, _ := c.DescribeChangeSetRequest(inCpy)
58			req.SetContext(ctx)
59			req.ApplyOptions(opts...)
60			return req, nil
61		},
62	}
63	w.ApplyOptions(opts...)
64
65	return w.WaitWithContext(ctx)
66}
67
68// WaitUntilStackCreateComplete uses the AWS CloudFormation API operation
69// DescribeStacks to wait for a condition to be met before returning.
70// If the condition is not met within the max attempt window, an error will
71// be returned.
72func (c *CloudFormation) WaitUntilStackCreateComplete(input *DescribeStacksInput) error {
73	return c.WaitUntilStackCreateCompleteWithContext(aws.BackgroundContext(), input)
74}
75
76// WaitUntilStackCreateCompleteWithContext is an extended version of WaitUntilStackCreateComplete.
77// With the support for passing in a context and options to configure the
78// Waiter and the underlying request options.
79//
80// The context must be non-nil and will be used for request cancellation. If
81// the context is nil a panic will occur. In the future the SDK may create
82// sub-contexts for http.Requests. See https://golang.org/pkg/context/
83// for more information on using Contexts.
84func (c *CloudFormation) WaitUntilStackCreateCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error {
85	w := request.Waiter{
86		Name:        "WaitUntilStackCreateComplete",
87		MaxAttempts: 120,
88		Delay:       request.ConstantWaiterDelay(30 * time.Second),
89		Acceptors: []request.WaiterAcceptor{
90			{
91				State:   request.SuccessWaiterState,
92				Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus",
93				Expected: "CREATE_COMPLETE",
94			},
95			{
96				State:   request.FailureWaiterState,
97				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
98				Expected: "CREATE_FAILED",
99			},
100			{
101				State:   request.FailureWaiterState,
102				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
103				Expected: "DELETE_COMPLETE",
104			},
105			{
106				State:   request.FailureWaiterState,
107				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
108				Expected: "DELETE_FAILED",
109			},
110			{
111				State:   request.FailureWaiterState,
112				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
113				Expected: "ROLLBACK_FAILED",
114			},
115			{
116				State:   request.FailureWaiterState,
117				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
118				Expected: "ROLLBACK_COMPLETE",
119			},
120			{
121				State:    request.FailureWaiterState,
122				Matcher:  request.ErrorWaiterMatch,
123				Expected: "ValidationError",
124			},
125		},
126		Logger: c.Config.Logger,
127		NewRequest: func(opts []request.Option) (*request.Request, error) {
128			var inCpy *DescribeStacksInput
129			if input != nil {
130				tmp := *input
131				inCpy = &tmp
132			}
133			req, _ := c.DescribeStacksRequest(inCpy)
134			req.SetContext(ctx)
135			req.ApplyOptions(opts...)
136			return req, nil
137		},
138	}
139	w.ApplyOptions(opts...)
140
141	return w.WaitWithContext(ctx)
142}
143
144// WaitUntilStackDeleteComplete uses the AWS CloudFormation API operation
145// DescribeStacks to wait for a condition to be met before returning.
146// If the condition is not met within the max attempt window, an error will
147// be returned.
148func (c *CloudFormation) WaitUntilStackDeleteComplete(input *DescribeStacksInput) error {
149	return c.WaitUntilStackDeleteCompleteWithContext(aws.BackgroundContext(), input)
150}
151
152// WaitUntilStackDeleteCompleteWithContext is an extended version of WaitUntilStackDeleteComplete.
153// With the support for passing in a context and options to configure the
154// Waiter and the underlying request options.
155//
156// The context must be non-nil and will be used for request cancellation. If
157// the context is nil a panic will occur. In the future the SDK may create
158// sub-contexts for http.Requests. See https://golang.org/pkg/context/
159// for more information on using Contexts.
160func (c *CloudFormation) WaitUntilStackDeleteCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error {
161	w := request.Waiter{
162		Name:        "WaitUntilStackDeleteComplete",
163		MaxAttempts: 120,
164		Delay:       request.ConstantWaiterDelay(30 * time.Second),
165		Acceptors: []request.WaiterAcceptor{
166			{
167				State:   request.SuccessWaiterState,
168				Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus",
169				Expected: "DELETE_COMPLETE",
170			},
171			{
172				State:    request.SuccessWaiterState,
173				Matcher:  request.ErrorWaiterMatch,
174				Expected: "ValidationError",
175			},
176			{
177				State:   request.FailureWaiterState,
178				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
179				Expected: "DELETE_FAILED",
180			},
181			{
182				State:   request.FailureWaiterState,
183				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
184				Expected: "CREATE_FAILED",
185			},
186			{
187				State:   request.FailureWaiterState,
188				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
189				Expected: "ROLLBACK_FAILED",
190			},
191			{
192				State:   request.FailureWaiterState,
193				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
194				Expected: "UPDATE_ROLLBACK_IN_PROGRESS",
195			},
196			{
197				State:   request.FailureWaiterState,
198				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
199				Expected: "UPDATE_ROLLBACK_FAILED",
200			},
201			{
202				State:   request.FailureWaiterState,
203				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
204				Expected: "UPDATE_ROLLBACK_COMPLETE",
205			},
206		},
207		Logger: c.Config.Logger,
208		NewRequest: func(opts []request.Option) (*request.Request, error) {
209			var inCpy *DescribeStacksInput
210			if input != nil {
211				tmp := *input
212				inCpy = &tmp
213			}
214			req, _ := c.DescribeStacksRequest(inCpy)
215			req.SetContext(ctx)
216			req.ApplyOptions(opts...)
217			return req, nil
218		},
219	}
220	w.ApplyOptions(opts...)
221
222	return w.WaitWithContext(ctx)
223}
224
225// WaitUntilStackExists uses the AWS CloudFormation API operation
226// DescribeStacks to wait for a condition to be met before returning.
227// If the condition is not met within the max attempt window, an error will
228// be returned.
229func (c *CloudFormation) WaitUntilStackExists(input *DescribeStacksInput) error {
230	return c.WaitUntilStackExistsWithContext(aws.BackgroundContext(), input)
231}
232
233// WaitUntilStackExistsWithContext is an extended version of WaitUntilStackExists.
234// With the support for passing in a context and options to configure the
235// Waiter and the underlying request options.
236//
237// The context must be non-nil and will be used for request cancellation. If
238// the context is nil a panic will occur. In the future the SDK may create
239// sub-contexts for http.Requests. See https://golang.org/pkg/context/
240// for more information on using Contexts.
241func (c *CloudFormation) WaitUntilStackExistsWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error {
242	w := request.Waiter{
243		Name:        "WaitUntilStackExists",
244		MaxAttempts: 20,
245		Delay:       request.ConstantWaiterDelay(5 * time.Second),
246		Acceptors: []request.WaiterAcceptor{
247			{
248				State:    request.SuccessWaiterState,
249				Matcher:  request.StatusWaiterMatch,
250				Expected: 200,
251			},
252			{
253				State:    request.RetryWaiterState,
254				Matcher:  request.ErrorWaiterMatch,
255				Expected: "ValidationError",
256			},
257		},
258		Logger: c.Config.Logger,
259		NewRequest: func(opts []request.Option) (*request.Request, error) {
260			var inCpy *DescribeStacksInput
261			if input != nil {
262				tmp := *input
263				inCpy = &tmp
264			}
265			req, _ := c.DescribeStacksRequest(inCpy)
266			req.SetContext(ctx)
267			req.ApplyOptions(opts...)
268			return req, nil
269		},
270	}
271	w.ApplyOptions(opts...)
272
273	return w.WaitWithContext(ctx)
274}
275
276// WaitUntilStackImportComplete uses the AWS CloudFormation API operation
277// DescribeStacks to wait for a condition to be met before returning.
278// If the condition is not met within the max attempt window, an error will
279// be returned.
280func (c *CloudFormation) WaitUntilStackImportComplete(input *DescribeStacksInput) error {
281	return c.WaitUntilStackImportCompleteWithContext(aws.BackgroundContext(), input)
282}
283
284// WaitUntilStackImportCompleteWithContext is an extended version of WaitUntilStackImportComplete.
285// With the support for passing in a context and options to configure the
286// Waiter and the underlying request options.
287//
288// The context must be non-nil and will be used for request cancellation. If
289// the context is nil a panic will occur. In the future the SDK may create
290// sub-contexts for http.Requests. See https://golang.org/pkg/context/
291// for more information on using Contexts.
292func (c *CloudFormation) WaitUntilStackImportCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error {
293	w := request.Waiter{
294		Name:        "WaitUntilStackImportComplete",
295		MaxAttempts: 120,
296		Delay:       request.ConstantWaiterDelay(30 * time.Second),
297		Acceptors: []request.WaiterAcceptor{
298			{
299				State:   request.SuccessWaiterState,
300				Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus",
301				Expected: "IMPORT_COMPLETE",
302			},
303			{
304				State:   request.FailureWaiterState,
305				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
306				Expected: "ROLLBACK_COMPLETE",
307			},
308			{
309				State:   request.FailureWaiterState,
310				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
311				Expected: "ROLLBACK_FAILED",
312			},
313			{
314				State:   request.FailureWaiterState,
315				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
316				Expected: "IMPORT_ROLLBACK_IN_PROGRESS",
317			},
318			{
319				State:   request.FailureWaiterState,
320				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
321				Expected: "IMPORT_ROLLBACK_FAILED",
322			},
323			{
324				State:   request.FailureWaiterState,
325				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
326				Expected: "IMPORT_ROLLBACK_COMPLETE",
327			},
328			{
329				State:    request.FailureWaiterState,
330				Matcher:  request.ErrorWaiterMatch,
331				Expected: "ValidationError",
332			},
333		},
334		Logger: c.Config.Logger,
335		NewRequest: func(opts []request.Option) (*request.Request, error) {
336			var inCpy *DescribeStacksInput
337			if input != nil {
338				tmp := *input
339				inCpy = &tmp
340			}
341			req, _ := c.DescribeStacksRequest(inCpy)
342			req.SetContext(ctx)
343			req.ApplyOptions(opts...)
344			return req, nil
345		},
346	}
347	w.ApplyOptions(opts...)
348
349	return w.WaitWithContext(ctx)
350}
351
352// WaitUntilStackRollbackComplete uses the AWS CloudFormation API operation
353// DescribeStacks to wait for a condition to be met before returning.
354// If the condition is not met within the max attempt window, an error will
355// be returned.
356func (c *CloudFormation) WaitUntilStackRollbackComplete(input *DescribeStacksInput) error {
357	return c.WaitUntilStackRollbackCompleteWithContext(aws.BackgroundContext(), input)
358}
359
360// WaitUntilStackRollbackCompleteWithContext is an extended version of WaitUntilStackRollbackComplete.
361// With the support for passing in a context and options to configure the
362// Waiter and the underlying request options.
363//
364// The context must be non-nil and will be used for request cancellation. If
365// the context is nil a panic will occur. In the future the SDK may create
366// sub-contexts for http.Requests. See https://golang.org/pkg/context/
367// for more information on using Contexts.
368func (c *CloudFormation) WaitUntilStackRollbackCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error {
369	w := request.Waiter{
370		Name:        "WaitUntilStackRollbackComplete",
371		MaxAttempts: 120,
372		Delay:       request.ConstantWaiterDelay(30 * time.Second),
373		Acceptors: []request.WaiterAcceptor{
374			{
375				State:   request.SuccessWaiterState,
376				Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus",
377				Expected: "UPDATE_ROLLBACK_COMPLETE",
378			},
379			{
380				State:   request.FailureWaiterState,
381				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
382				Expected: "UPDATE_FAILED",
383			},
384			{
385				State:   request.FailureWaiterState,
386				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
387				Expected: "UPDATE_ROLLBACK_FAILED",
388			},
389			{
390				State:   request.FailureWaiterState,
391				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
392				Expected: "DELETE_FAILED",
393			},
394			{
395				State:    request.FailureWaiterState,
396				Matcher:  request.ErrorWaiterMatch,
397				Expected: "ValidationError",
398			},
399		},
400		Logger: c.Config.Logger,
401		NewRequest: func(opts []request.Option) (*request.Request, error) {
402			var inCpy *DescribeStacksInput
403			if input != nil {
404				tmp := *input
405				inCpy = &tmp
406			}
407			req, _ := c.DescribeStacksRequest(inCpy)
408			req.SetContext(ctx)
409			req.ApplyOptions(opts...)
410			return req, nil
411		},
412	}
413	w.ApplyOptions(opts...)
414
415	return w.WaitWithContext(ctx)
416}
417
418// WaitUntilStackUpdateComplete uses the AWS CloudFormation API operation
419// DescribeStacks to wait for a condition to be met before returning.
420// If the condition is not met within the max attempt window, an error will
421// be returned.
422func (c *CloudFormation) WaitUntilStackUpdateComplete(input *DescribeStacksInput) error {
423	return c.WaitUntilStackUpdateCompleteWithContext(aws.BackgroundContext(), input)
424}
425
426// WaitUntilStackUpdateCompleteWithContext is an extended version of WaitUntilStackUpdateComplete.
427// With the support for passing in a context and options to configure the
428// Waiter and the underlying request options.
429//
430// The context must be non-nil and will be used for request cancellation. If
431// the context is nil a panic will occur. In the future the SDK may create
432// sub-contexts for http.Requests. See https://golang.org/pkg/context/
433// for more information on using Contexts.
434func (c *CloudFormation) WaitUntilStackUpdateCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error {
435	w := request.Waiter{
436		Name:        "WaitUntilStackUpdateComplete",
437		MaxAttempts: 120,
438		Delay:       request.ConstantWaiterDelay(30 * time.Second),
439		Acceptors: []request.WaiterAcceptor{
440			{
441				State:   request.SuccessWaiterState,
442				Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus",
443				Expected: "UPDATE_COMPLETE",
444			},
445			{
446				State:   request.FailureWaiterState,
447				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
448				Expected: "UPDATE_FAILED",
449			},
450			{
451				State:   request.FailureWaiterState,
452				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
453				Expected: "UPDATE_ROLLBACK_FAILED",
454			},
455			{
456				State:   request.FailureWaiterState,
457				Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus",
458				Expected: "UPDATE_ROLLBACK_COMPLETE",
459			},
460			{
461				State:    request.FailureWaiterState,
462				Matcher:  request.ErrorWaiterMatch,
463				Expected: "ValidationError",
464			},
465		},
466		Logger: c.Config.Logger,
467		NewRequest: func(opts []request.Option) (*request.Request, error) {
468			var inCpy *DescribeStacksInput
469			if input != nil {
470				tmp := *input
471				inCpy = &tmp
472			}
473			req, _ := c.DescribeStacksRequest(inCpy)
474			req.SetContext(ctx)
475			req.ApplyOptions(opts...)
476			return req, nil
477		},
478	}
479	w.ApplyOptions(opts...)
480
481	return w.WaitWithContext(ctx)
482}
483
484// WaitUntilTypeRegistrationComplete uses the AWS CloudFormation API operation
485// DescribeTypeRegistration to wait for a condition to be met before returning.
486// If the condition is not met within the max attempt window, an error will
487// be returned.
488func (c *CloudFormation) WaitUntilTypeRegistrationComplete(input *DescribeTypeRegistrationInput) error {
489	return c.WaitUntilTypeRegistrationCompleteWithContext(aws.BackgroundContext(), input)
490}
491
492// WaitUntilTypeRegistrationCompleteWithContext is an extended version of WaitUntilTypeRegistrationComplete.
493// With the support for passing in a context and options to configure the
494// Waiter and the underlying request options.
495//
496// The context must be non-nil and will be used for request cancellation. If
497// the context is nil a panic will occur. In the future the SDK may create
498// sub-contexts for http.Requests. See https://golang.org/pkg/context/
499// for more information on using Contexts.
500func (c *CloudFormation) WaitUntilTypeRegistrationCompleteWithContext(ctx aws.Context, input *DescribeTypeRegistrationInput, opts ...request.WaiterOption) error {
501	w := request.Waiter{
502		Name:        "WaitUntilTypeRegistrationComplete",
503		MaxAttempts: 120,
504		Delay:       request.ConstantWaiterDelay(30 * time.Second),
505		Acceptors: []request.WaiterAcceptor{
506			{
507				State:   request.SuccessWaiterState,
508				Matcher: request.PathWaiterMatch, Argument: "ProgressStatus",
509				Expected: "COMPLETE",
510			},
511			{
512				State:   request.FailureWaiterState,
513				Matcher: request.PathWaiterMatch, Argument: "ProgressStatus",
514				Expected: "FAILED",
515			},
516		},
517		Logger: c.Config.Logger,
518		NewRequest: func(opts []request.Option) (*request.Request, error) {
519			var inCpy *DescribeTypeRegistrationInput
520			if input != nil {
521				tmp := *input
522				inCpy = &tmp
523			}
524			req, _ := c.DescribeTypeRegistrationRequest(inCpy)
525			req.SetContext(ctx)
526			req.ApplyOptions(opts...)
527			return req, nil
528		},
529	}
530	w.ApplyOptions(opts...)
531
532	return w.WaitWithContext(ctx)
533}
534