1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package ec2 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// WaitUntilBundleTaskComplete uses the Amazon EC2 API operation 13// DescribeBundleTasks 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 *EC2) WaitUntilBundleTaskComplete(input *DescribeBundleTasksInput) error { 17 return c.WaitUntilBundleTaskCompleteWithContext(aws.BackgroundContext(), input) 18} 19 20// WaitUntilBundleTaskCompleteWithContext is an extended version of WaitUntilBundleTaskComplete. 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 *EC2) WaitUntilBundleTaskCompleteWithContext(ctx aws.Context, input *DescribeBundleTasksInput, opts ...request.WaiterOption) error { 29 w := request.Waiter{ 30 Name: "WaitUntilBundleTaskComplete", 31 MaxAttempts: 40, 32 Delay: request.ConstantWaiterDelay(15 * time.Second), 33 Acceptors: []request.WaiterAcceptor{ 34 { 35 State: request.SuccessWaiterState, 36 Matcher: request.PathAllWaiterMatch, Argument: "BundleTasks[].State", 37 Expected: "complete", 38 }, 39 { 40 State: request.FailureWaiterState, 41 Matcher: request.PathAnyWaiterMatch, Argument: "BundleTasks[].State", 42 Expected: "failed", 43 }, 44 }, 45 Logger: c.Config.Logger, 46 NewRequest: func(opts []request.Option) (*request.Request, error) { 47 var inCpy *DescribeBundleTasksInput 48 if input != nil { 49 tmp := *input 50 inCpy = &tmp 51 } 52 req, _ := c.DescribeBundleTasksRequest(inCpy) 53 req.SetContext(ctx) 54 req.ApplyOptions(opts...) 55 return req, nil 56 }, 57 } 58 w.ApplyOptions(opts...) 59 60 return w.WaitWithContext(ctx) 61} 62 63// WaitUntilConversionTaskCancelled uses the Amazon EC2 API operation 64// DescribeConversionTasks to wait for a condition to be met before returning. 65// If the condition is not met within the max attempt window, an error will 66// be returned. 67func (c *EC2) WaitUntilConversionTaskCancelled(input *DescribeConversionTasksInput) error { 68 return c.WaitUntilConversionTaskCancelledWithContext(aws.BackgroundContext(), input) 69} 70 71// WaitUntilConversionTaskCancelledWithContext is an extended version of WaitUntilConversionTaskCancelled. 72// With the support for passing in a context and options to configure the 73// Waiter and the underlying request options. 74// 75// The context must be non-nil and will be used for request cancellation. If 76// the context is nil a panic will occur. In the future the SDK may create 77// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 78// for more information on using Contexts. 79func (c *EC2) WaitUntilConversionTaskCancelledWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { 80 w := request.Waiter{ 81 Name: "WaitUntilConversionTaskCancelled", 82 MaxAttempts: 40, 83 Delay: request.ConstantWaiterDelay(15 * time.Second), 84 Acceptors: []request.WaiterAcceptor{ 85 { 86 State: request.SuccessWaiterState, 87 Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", 88 Expected: "cancelled", 89 }, 90 }, 91 Logger: c.Config.Logger, 92 NewRequest: func(opts []request.Option) (*request.Request, error) { 93 var inCpy *DescribeConversionTasksInput 94 if input != nil { 95 tmp := *input 96 inCpy = &tmp 97 } 98 req, _ := c.DescribeConversionTasksRequest(inCpy) 99 req.SetContext(ctx) 100 req.ApplyOptions(opts...) 101 return req, nil 102 }, 103 } 104 w.ApplyOptions(opts...) 105 106 return w.WaitWithContext(ctx) 107} 108 109// WaitUntilConversionTaskCompleted uses the Amazon EC2 API operation 110// DescribeConversionTasks to wait for a condition to be met before returning. 111// If the condition is not met within the max attempt window, an error will 112// be returned. 113func (c *EC2) WaitUntilConversionTaskCompleted(input *DescribeConversionTasksInput) error { 114 return c.WaitUntilConversionTaskCompletedWithContext(aws.BackgroundContext(), input) 115} 116 117// WaitUntilConversionTaskCompletedWithContext is an extended version of WaitUntilConversionTaskCompleted. 118// With the support for passing in a context and options to configure the 119// Waiter and the underlying request options. 120// 121// The context must be non-nil and will be used for request cancellation. If 122// the context is nil a panic will occur. In the future the SDK may create 123// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 124// for more information on using Contexts. 125func (c *EC2) WaitUntilConversionTaskCompletedWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { 126 w := request.Waiter{ 127 Name: "WaitUntilConversionTaskCompleted", 128 MaxAttempts: 40, 129 Delay: request.ConstantWaiterDelay(15 * time.Second), 130 Acceptors: []request.WaiterAcceptor{ 131 { 132 State: request.SuccessWaiterState, 133 Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", 134 Expected: "completed", 135 }, 136 { 137 State: request.FailureWaiterState, 138 Matcher: request.PathAnyWaiterMatch, Argument: "ConversionTasks[].State", 139 Expected: "cancelled", 140 }, 141 { 142 State: request.FailureWaiterState, 143 Matcher: request.PathAnyWaiterMatch, Argument: "ConversionTasks[].State", 144 Expected: "cancelling", 145 }, 146 }, 147 Logger: c.Config.Logger, 148 NewRequest: func(opts []request.Option) (*request.Request, error) { 149 var inCpy *DescribeConversionTasksInput 150 if input != nil { 151 tmp := *input 152 inCpy = &tmp 153 } 154 req, _ := c.DescribeConversionTasksRequest(inCpy) 155 req.SetContext(ctx) 156 req.ApplyOptions(opts...) 157 return req, nil 158 }, 159 } 160 w.ApplyOptions(opts...) 161 162 return w.WaitWithContext(ctx) 163} 164 165// WaitUntilConversionTaskDeleted uses the Amazon EC2 API operation 166// DescribeConversionTasks to wait for a condition to be met before returning. 167// If the condition is not met within the max attempt window, an error will 168// be returned. 169func (c *EC2) WaitUntilConversionTaskDeleted(input *DescribeConversionTasksInput) error { 170 return c.WaitUntilConversionTaskDeletedWithContext(aws.BackgroundContext(), input) 171} 172 173// WaitUntilConversionTaskDeletedWithContext is an extended version of WaitUntilConversionTaskDeleted. 174// With the support for passing in a context and options to configure the 175// Waiter and the underlying request options. 176// 177// The context must be non-nil and will be used for request cancellation. If 178// the context is nil a panic will occur. In the future the SDK may create 179// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 180// for more information on using Contexts. 181func (c *EC2) WaitUntilConversionTaskDeletedWithContext(ctx aws.Context, input *DescribeConversionTasksInput, opts ...request.WaiterOption) error { 182 w := request.Waiter{ 183 Name: "WaitUntilConversionTaskDeleted", 184 MaxAttempts: 40, 185 Delay: request.ConstantWaiterDelay(15 * time.Second), 186 Acceptors: []request.WaiterAcceptor{ 187 { 188 State: request.SuccessWaiterState, 189 Matcher: request.PathAllWaiterMatch, Argument: "ConversionTasks[].State", 190 Expected: "deleted", 191 }, 192 }, 193 Logger: c.Config.Logger, 194 NewRequest: func(opts []request.Option) (*request.Request, error) { 195 var inCpy *DescribeConversionTasksInput 196 if input != nil { 197 tmp := *input 198 inCpy = &tmp 199 } 200 req, _ := c.DescribeConversionTasksRequest(inCpy) 201 req.SetContext(ctx) 202 req.ApplyOptions(opts...) 203 return req, nil 204 }, 205 } 206 w.ApplyOptions(opts...) 207 208 return w.WaitWithContext(ctx) 209} 210 211// WaitUntilCustomerGatewayAvailable uses the Amazon EC2 API operation 212// DescribeCustomerGateways to wait for a condition to be met before returning. 213// If the condition is not met within the max attempt window, an error will 214// be returned. 215func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysInput) error { 216 return c.WaitUntilCustomerGatewayAvailableWithContext(aws.BackgroundContext(), input) 217} 218 219// WaitUntilCustomerGatewayAvailableWithContext is an extended version of WaitUntilCustomerGatewayAvailable. 220// With the support for passing in a context and options to configure the 221// Waiter and the underlying request options. 222// 223// The context must be non-nil and will be used for request cancellation. If 224// the context is nil a panic will occur. In the future the SDK may create 225// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 226// for more information on using Contexts. 227func (c *EC2) WaitUntilCustomerGatewayAvailableWithContext(ctx aws.Context, input *DescribeCustomerGatewaysInput, opts ...request.WaiterOption) error { 228 w := request.Waiter{ 229 Name: "WaitUntilCustomerGatewayAvailable", 230 MaxAttempts: 40, 231 Delay: request.ConstantWaiterDelay(15 * time.Second), 232 Acceptors: []request.WaiterAcceptor{ 233 { 234 State: request.SuccessWaiterState, 235 Matcher: request.PathAllWaiterMatch, Argument: "CustomerGateways[].State", 236 Expected: "available", 237 }, 238 { 239 State: request.FailureWaiterState, 240 Matcher: request.PathAnyWaiterMatch, Argument: "CustomerGateways[].State", 241 Expected: "deleted", 242 }, 243 { 244 State: request.FailureWaiterState, 245 Matcher: request.PathAnyWaiterMatch, Argument: "CustomerGateways[].State", 246 Expected: "deleting", 247 }, 248 }, 249 Logger: c.Config.Logger, 250 NewRequest: func(opts []request.Option) (*request.Request, error) { 251 var inCpy *DescribeCustomerGatewaysInput 252 if input != nil { 253 tmp := *input 254 inCpy = &tmp 255 } 256 req, _ := c.DescribeCustomerGatewaysRequest(inCpy) 257 req.SetContext(ctx) 258 req.ApplyOptions(opts...) 259 return req, nil 260 }, 261 } 262 w.ApplyOptions(opts...) 263 264 return w.WaitWithContext(ctx) 265} 266 267// WaitUntilExportTaskCancelled uses the Amazon EC2 API operation 268// DescribeExportTasks to wait for a condition to be met before returning. 269// If the condition is not met within the max attempt window, an error will 270// be returned. 271func (c *EC2) WaitUntilExportTaskCancelled(input *DescribeExportTasksInput) error { 272 return c.WaitUntilExportTaskCancelledWithContext(aws.BackgroundContext(), input) 273} 274 275// WaitUntilExportTaskCancelledWithContext is an extended version of WaitUntilExportTaskCancelled. 276// With the support for passing in a context and options to configure the 277// Waiter and the underlying request options. 278// 279// The context must be non-nil and will be used for request cancellation. If 280// the context is nil a panic will occur. In the future the SDK may create 281// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 282// for more information on using Contexts. 283func (c *EC2) WaitUntilExportTaskCancelledWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.WaiterOption) error { 284 w := request.Waiter{ 285 Name: "WaitUntilExportTaskCancelled", 286 MaxAttempts: 40, 287 Delay: request.ConstantWaiterDelay(15 * time.Second), 288 Acceptors: []request.WaiterAcceptor{ 289 { 290 State: request.SuccessWaiterState, 291 Matcher: request.PathAllWaiterMatch, Argument: "ExportTasks[].State", 292 Expected: "cancelled", 293 }, 294 }, 295 Logger: c.Config.Logger, 296 NewRequest: func(opts []request.Option) (*request.Request, error) { 297 var inCpy *DescribeExportTasksInput 298 if input != nil { 299 tmp := *input 300 inCpy = &tmp 301 } 302 req, _ := c.DescribeExportTasksRequest(inCpy) 303 req.SetContext(ctx) 304 req.ApplyOptions(opts...) 305 return req, nil 306 }, 307 } 308 w.ApplyOptions(opts...) 309 310 return w.WaitWithContext(ctx) 311} 312 313// WaitUntilExportTaskCompleted uses the Amazon EC2 API operation 314// DescribeExportTasks to wait for a condition to be met before returning. 315// If the condition is not met within the max attempt window, an error will 316// be returned. 317func (c *EC2) WaitUntilExportTaskCompleted(input *DescribeExportTasksInput) error { 318 return c.WaitUntilExportTaskCompletedWithContext(aws.BackgroundContext(), input) 319} 320 321// WaitUntilExportTaskCompletedWithContext is an extended version of WaitUntilExportTaskCompleted. 322// With the support for passing in a context and options to configure the 323// Waiter and the underlying request options. 324// 325// The context must be non-nil and will be used for request cancellation. If 326// the context is nil a panic will occur. In the future the SDK may create 327// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 328// for more information on using Contexts. 329func (c *EC2) WaitUntilExportTaskCompletedWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.WaiterOption) error { 330 w := request.Waiter{ 331 Name: "WaitUntilExportTaskCompleted", 332 MaxAttempts: 40, 333 Delay: request.ConstantWaiterDelay(15 * time.Second), 334 Acceptors: []request.WaiterAcceptor{ 335 { 336 State: request.SuccessWaiterState, 337 Matcher: request.PathAllWaiterMatch, Argument: "ExportTasks[].State", 338 Expected: "completed", 339 }, 340 }, 341 Logger: c.Config.Logger, 342 NewRequest: func(opts []request.Option) (*request.Request, error) { 343 var inCpy *DescribeExportTasksInput 344 if input != nil { 345 tmp := *input 346 inCpy = &tmp 347 } 348 req, _ := c.DescribeExportTasksRequest(inCpy) 349 req.SetContext(ctx) 350 req.ApplyOptions(opts...) 351 return req, nil 352 }, 353 } 354 w.ApplyOptions(opts...) 355 356 return w.WaitWithContext(ctx) 357} 358 359// WaitUntilImageAvailable uses the Amazon EC2 API operation 360// DescribeImages to wait for a condition to be met before returning. 361// If the condition is not met within the max attempt window, an error will 362// be returned. 363func (c *EC2) WaitUntilImageAvailable(input *DescribeImagesInput) error { 364 return c.WaitUntilImageAvailableWithContext(aws.BackgroundContext(), input) 365} 366 367// WaitUntilImageAvailableWithContext is an extended version of WaitUntilImageAvailable. 368// With the support for passing in a context and options to configure the 369// Waiter and the underlying request options. 370// 371// The context must be non-nil and will be used for request cancellation. If 372// the context is nil a panic will occur. In the future the SDK may create 373// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 374// for more information on using Contexts. 375func (c *EC2) WaitUntilImageAvailableWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.WaiterOption) error { 376 w := request.Waiter{ 377 Name: "WaitUntilImageAvailable", 378 MaxAttempts: 40, 379 Delay: request.ConstantWaiterDelay(15 * time.Second), 380 Acceptors: []request.WaiterAcceptor{ 381 { 382 State: request.SuccessWaiterState, 383 Matcher: request.PathAllWaiterMatch, Argument: "Images[].State", 384 Expected: "available", 385 }, 386 { 387 State: request.FailureWaiterState, 388 Matcher: request.PathAnyWaiterMatch, Argument: "Images[].State", 389 Expected: "failed", 390 }, 391 }, 392 Logger: c.Config.Logger, 393 NewRequest: func(opts []request.Option) (*request.Request, error) { 394 var inCpy *DescribeImagesInput 395 if input != nil { 396 tmp := *input 397 inCpy = &tmp 398 } 399 req, _ := c.DescribeImagesRequest(inCpy) 400 req.SetContext(ctx) 401 req.ApplyOptions(opts...) 402 return req, nil 403 }, 404 } 405 w.ApplyOptions(opts...) 406 407 return w.WaitWithContext(ctx) 408} 409 410// WaitUntilImageExists uses the Amazon EC2 API operation 411// DescribeImages to wait for a condition to be met before returning. 412// If the condition is not met within the max attempt window, an error will 413// be returned. 414func (c *EC2) WaitUntilImageExists(input *DescribeImagesInput) error { 415 return c.WaitUntilImageExistsWithContext(aws.BackgroundContext(), input) 416} 417 418// WaitUntilImageExistsWithContext is an extended version of WaitUntilImageExists. 419// With the support for passing in a context and options to configure the 420// Waiter and the underlying request options. 421// 422// The context must be non-nil and will be used for request cancellation. If 423// the context is nil a panic will occur. In the future the SDK may create 424// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 425// for more information on using Contexts. 426func (c *EC2) WaitUntilImageExistsWithContext(ctx aws.Context, input *DescribeImagesInput, opts ...request.WaiterOption) error { 427 w := request.Waiter{ 428 Name: "WaitUntilImageExists", 429 MaxAttempts: 40, 430 Delay: request.ConstantWaiterDelay(15 * time.Second), 431 Acceptors: []request.WaiterAcceptor{ 432 { 433 State: request.SuccessWaiterState, 434 Matcher: request.PathWaiterMatch, Argument: "length(Images[]) > `0`", 435 Expected: true, 436 }, 437 { 438 State: request.RetryWaiterState, 439 Matcher: request.ErrorWaiterMatch, 440 Expected: "InvalidAMIID.NotFound", 441 }, 442 }, 443 Logger: c.Config.Logger, 444 NewRequest: func(opts []request.Option) (*request.Request, error) { 445 var inCpy *DescribeImagesInput 446 if input != nil { 447 tmp := *input 448 inCpy = &tmp 449 } 450 req, _ := c.DescribeImagesRequest(inCpy) 451 req.SetContext(ctx) 452 req.ApplyOptions(opts...) 453 return req, nil 454 }, 455 } 456 w.ApplyOptions(opts...) 457 458 return w.WaitWithContext(ctx) 459} 460 461// WaitUntilInstanceExists uses the Amazon EC2 API operation 462// DescribeInstances to wait for a condition to be met before returning. 463// If the condition is not met within the max attempt window, an error will 464// be returned. 465func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error { 466 return c.WaitUntilInstanceExistsWithContext(aws.BackgroundContext(), input) 467} 468 469// WaitUntilInstanceExistsWithContext is an extended version of WaitUntilInstanceExists. 470// With the support for passing in a context and options to configure the 471// Waiter and the underlying request options. 472// 473// The context must be non-nil and will be used for request cancellation. If 474// the context is nil a panic will occur. In the future the SDK may create 475// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 476// for more information on using Contexts. 477func (c *EC2) WaitUntilInstanceExistsWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { 478 w := request.Waiter{ 479 Name: "WaitUntilInstanceExists", 480 MaxAttempts: 40, 481 Delay: request.ConstantWaiterDelay(5 * time.Second), 482 Acceptors: []request.WaiterAcceptor{ 483 { 484 State: request.SuccessWaiterState, 485 Matcher: request.PathWaiterMatch, Argument: "length(Reservations[]) > `0`", 486 Expected: true, 487 }, 488 { 489 State: request.RetryWaiterState, 490 Matcher: request.ErrorWaiterMatch, 491 Expected: "InvalidInstanceID.NotFound", 492 }, 493 }, 494 Logger: c.Config.Logger, 495 NewRequest: func(opts []request.Option) (*request.Request, error) { 496 var inCpy *DescribeInstancesInput 497 if input != nil { 498 tmp := *input 499 inCpy = &tmp 500 } 501 req, _ := c.DescribeInstancesRequest(inCpy) 502 req.SetContext(ctx) 503 req.ApplyOptions(opts...) 504 return req, nil 505 }, 506 } 507 w.ApplyOptions(opts...) 508 509 return w.WaitWithContext(ctx) 510} 511 512// WaitUntilInstanceRunning uses the Amazon EC2 API operation 513// DescribeInstances to wait for a condition to be met before returning. 514// If the condition is not met within the max attempt window, an error will 515// be returned. 516func (c *EC2) WaitUntilInstanceRunning(input *DescribeInstancesInput) error { 517 return c.WaitUntilInstanceRunningWithContext(aws.BackgroundContext(), input) 518} 519 520// WaitUntilInstanceRunningWithContext is an extended version of WaitUntilInstanceRunning. 521// With the support for passing in a context and options to configure the 522// Waiter and the underlying request options. 523// 524// The context must be non-nil and will be used for request cancellation. If 525// the context is nil a panic will occur. In the future the SDK may create 526// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 527// for more information on using Contexts. 528func (c *EC2) WaitUntilInstanceRunningWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { 529 w := request.Waiter{ 530 Name: "WaitUntilInstanceRunning", 531 MaxAttempts: 40, 532 Delay: request.ConstantWaiterDelay(15 * time.Second), 533 Acceptors: []request.WaiterAcceptor{ 534 { 535 State: request.SuccessWaiterState, 536 Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 537 Expected: "running", 538 }, 539 { 540 State: request.FailureWaiterState, 541 Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 542 Expected: "shutting-down", 543 }, 544 { 545 State: request.FailureWaiterState, 546 Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 547 Expected: "terminated", 548 }, 549 { 550 State: request.FailureWaiterState, 551 Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 552 Expected: "stopping", 553 }, 554 { 555 State: request.RetryWaiterState, 556 Matcher: request.ErrorWaiterMatch, 557 Expected: "InvalidInstanceID.NotFound", 558 }, 559 }, 560 Logger: c.Config.Logger, 561 NewRequest: func(opts []request.Option) (*request.Request, error) { 562 var inCpy *DescribeInstancesInput 563 if input != nil { 564 tmp := *input 565 inCpy = &tmp 566 } 567 req, _ := c.DescribeInstancesRequest(inCpy) 568 req.SetContext(ctx) 569 req.ApplyOptions(opts...) 570 return req, nil 571 }, 572 } 573 w.ApplyOptions(opts...) 574 575 return w.WaitWithContext(ctx) 576} 577 578// WaitUntilInstanceStatusOk uses the Amazon EC2 API operation 579// DescribeInstanceStatus to wait for a condition to be met before returning. 580// If the condition is not met within the max attempt window, an error will 581// be returned. 582func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) error { 583 return c.WaitUntilInstanceStatusOkWithContext(aws.BackgroundContext(), input) 584} 585 586// WaitUntilInstanceStatusOkWithContext is an extended version of WaitUntilInstanceStatusOk. 587// With the support for passing in a context and options to configure the 588// Waiter and the underlying request options. 589// 590// The context must be non-nil and will be used for request cancellation. If 591// the context is nil a panic will occur. In the future the SDK may create 592// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 593// for more information on using Contexts. 594func (c *EC2) WaitUntilInstanceStatusOkWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.WaiterOption) error { 595 w := request.Waiter{ 596 Name: "WaitUntilInstanceStatusOk", 597 MaxAttempts: 40, 598 Delay: request.ConstantWaiterDelay(15 * time.Second), 599 Acceptors: []request.WaiterAcceptor{ 600 { 601 State: request.SuccessWaiterState, 602 Matcher: request.PathAllWaiterMatch, Argument: "InstanceStatuses[].InstanceStatus.Status", 603 Expected: "ok", 604 }, 605 { 606 State: request.RetryWaiterState, 607 Matcher: request.ErrorWaiterMatch, 608 Expected: "InvalidInstanceID.NotFound", 609 }, 610 }, 611 Logger: c.Config.Logger, 612 NewRequest: func(opts []request.Option) (*request.Request, error) { 613 var inCpy *DescribeInstanceStatusInput 614 if input != nil { 615 tmp := *input 616 inCpy = &tmp 617 } 618 req, _ := c.DescribeInstanceStatusRequest(inCpy) 619 req.SetContext(ctx) 620 req.ApplyOptions(opts...) 621 return req, nil 622 }, 623 } 624 w.ApplyOptions(opts...) 625 626 return w.WaitWithContext(ctx) 627} 628 629// WaitUntilInstanceStopped uses the Amazon EC2 API operation 630// DescribeInstances to wait for a condition to be met before returning. 631// If the condition is not met within the max attempt window, an error will 632// be returned. 633func (c *EC2) WaitUntilInstanceStopped(input *DescribeInstancesInput) error { 634 return c.WaitUntilInstanceStoppedWithContext(aws.BackgroundContext(), input) 635} 636 637// WaitUntilInstanceStoppedWithContext is an extended version of WaitUntilInstanceStopped. 638// With the support for passing in a context and options to configure the 639// Waiter and the underlying request options. 640// 641// The context must be non-nil and will be used for request cancellation. If 642// the context is nil a panic will occur. In the future the SDK may create 643// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 644// for more information on using Contexts. 645func (c *EC2) WaitUntilInstanceStoppedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { 646 w := request.Waiter{ 647 Name: "WaitUntilInstanceStopped", 648 MaxAttempts: 40, 649 Delay: request.ConstantWaiterDelay(15 * time.Second), 650 Acceptors: []request.WaiterAcceptor{ 651 { 652 State: request.SuccessWaiterState, 653 Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 654 Expected: "stopped", 655 }, 656 { 657 State: request.FailureWaiterState, 658 Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 659 Expected: "pending", 660 }, 661 { 662 State: request.FailureWaiterState, 663 Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 664 Expected: "terminated", 665 }, 666 }, 667 Logger: c.Config.Logger, 668 NewRequest: func(opts []request.Option) (*request.Request, error) { 669 var inCpy *DescribeInstancesInput 670 if input != nil { 671 tmp := *input 672 inCpy = &tmp 673 } 674 req, _ := c.DescribeInstancesRequest(inCpy) 675 req.SetContext(ctx) 676 req.ApplyOptions(opts...) 677 return req, nil 678 }, 679 } 680 w.ApplyOptions(opts...) 681 682 return w.WaitWithContext(ctx) 683} 684 685// WaitUntilInstanceTerminated uses the Amazon EC2 API operation 686// DescribeInstances to wait for a condition to be met before returning. 687// If the condition is not met within the max attempt window, an error will 688// be returned. 689func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error { 690 return c.WaitUntilInstanceTerminatedWithContext(aws.BackgroundContext(), input) 691} 692 693// WaitUntilInstanceTerminatedWithContext is an extended version of WaitUntilInstanceTerminated. 694// With the support for passing in a context and options to configure the 695// Waiter and the underlying request options. 696// 697// The context must be non-nil and will be used for request cancellation. If 698// the context is nil a panic will occur. In the future the SDK may create 699// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 700// for more information on using Contexts. 701func (c *EC2) WaitUntilInstanceTerminatedWithContext(ctx aws.Context, input *DescribeInstancesInput, opts ...request.WaiterOption) error { 702 w := request.Waiter{ 703 Name: "WaitUntilInstanceTerminated", 704 MaxAttempts: 40, 705 Delay: request.ConstantWaiterDelay(15 * time.Second), 706 Acceptors: []request.WaiterAcceptor{ 707 { 708 State: request.SuccessWaiterState, 709 Matcher: request.PathAllWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 710 Expected: "terminated", 711 }, 712 { 713 State: request.FailureWaiterState, 714 Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 715 Expected: "pending", 716 }, 717 { 718 State: request.FailureWaiterState, 719 Matcher: request.PathAnyWaiterMatch, Argument: "Reservations[].Instances[].State.Name", 720 Expected: "stopping", 721 }, 722 }, 723 Logger: c.Config.Logger, 724 NewRequest: func(opts []request.Option) (*request.Request, error) { 725 var inCpy *DescribeInstancesInput 726 if input != nil { 727 tmp := *input 728 inCpy = &tmp 729 } 730 req, _ := c.DescribeInstancesRequest(inCpy) 731 req.SetContext(ctx) 732 req.ApplyOptions(opts...) 733 return req, nil 734 }, 735 } 736 w.ApplyOptions(opts...) 737 738 return w.WaitWithContext(ctx) 739} 740 741// WaitUntilKeyPairExists uses the Amazon EC2 API operation 742// DescribeKeyPairs to wait for a condition to be met before returning. 743// If the condition is not met within the max attempt window, an error will 744// be returned. 745func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error { 746 return c.WaitUntilKeyPairExistsWithContext(aws.BackgroundContext(), input) 747} 748 749// WaitUntilKeyPairExistsWithContext is an extended version of WaitUntilKeyPairExists. 750// With the support for passing in a context and options to configure the 751// Waiter and the underlying request options. 752// 753// The context must be non-nil and will be used for request cancellation. If 754// the context is nil a panic will occur. In the future the SDK may create 755// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 756// for more information on using Contexts. 757func (c *EC2) WaitUntilKeyPairExistsWithContext(ctx aws.Context, input *DescribeKeyPairsInput, opts ...request.WaiterOption) error { 758 w := request.Waiter{ 759 Name: "WaitUntilKeyPairExists", 760 MaxAttempts: 6, 761 Delay: request.ConstantWaiterDelay(5 * time.Second), 762 Acceptors: []request.WaiterAcceptor{ 763 { 764 State: request.SuccessWaiterState, 765 Matcher: request.PathWaiterMatch, Argument: "length(KeyPairs[].KeyName) > `0`", 766 Expected: true, 767 }, 768 { 769 State: request.RetryWaiterState, 770 Matcher: request.ErrorWaiterMatch, 771 Expected: "InvalidKeyPair.NotFound", 772 }, 773 }, 774 Logger: c.Config.Logger, 775 NewRequest: func(opts []request.Option) (*request.Request, error) { 776 var inCpy *DescribeKeyPairsInput 777 if input != nil { 778 tmp := *input 779 inCpy = &tmp 780 } 781 req, _ := c.DescribeKeyPairsRequest(inCpy) 782 req.SetContext(ctx) 783 req.ApplyOptions(opts...) 784 return req, nil 785 }, 786 } 787 w.ApplyOptions(opts...) 788 789 return w.WaitWithContext(ctx) 790} 791 792// WaitUntilNatGatewayAvailable uses the Amazon EC2 API operation 793// DescribeNatGateways to wait for a condition to be met before returning. 794// If the condition is not met within the max attempt window, an error will 795// be returned. 796func (c *EC2) WaitUntilNatGatewayAvailable(input *DescribeNatGatewaysInput) error { 797 return c.WaitUntilNatGatewayAvailableWithContext(aws.BackgroundContext(), input) 798} 799 800// WaitUntilNatGatewayAvailableWithContext is an extended version of WaitUntilNatGatewayAvailable. 801// With the support for passing in a context and options to configure the 802// Waiter and the underlying request options. 803// 804// The context must be non-nil and will be used for request cancellation. If 805// the context is nil a panic will occur. In the future the SDK may create 806// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 807// for more information on using Contexts. 808func (c *EC2) WaitUntilNatGatewayAvailableWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, opts ...request.WaiterOption) error { 809 w := request.Waiter{ 810 Name: "WaitUntilNatGatewayAvailable", 811 MaxAttempts: 40, 812 Delay: request.ConstantWaiterDelay(15 * time.Second), 813 Acceptors: []request.WaiterAcceptor{ 814 { 815 State: request.SuccessWaiterState, 816 Matcher: request.PathAllWaiterMatch, Argument: "NatGateways[].State", 817 Expected: "available", 818 }, 819 { 820 State: request.FailureWaiterState, 821 Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", 822 Expected: "failed", 823 }, 824 { 825 State: request.FailureWaiterState, 826 Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", 827 Expected: "deleting", 828 }, 829 { 830 State: request.FailureWaiterState, 831 Matcher: request.PathAnyWaiterMatch, Argument: "NatGateways[].State", 832 Expected: "deleted", 833 }, 834 { 835 State: request.RetryWaiterState, 836 Matcher: request.ErrorWaiterMatch, 837 Expected: "NatGatewayNotFound", 838 }, 839 }, 840 Logger: c.Config.Logger, 841 NewRequest: func(opts []request.Option) (*request.Request, error) { 842 var inCpy *DescribeNatGatewaysInput 843 if input != nil { 844 tmp := *input 845 inCpy = &tmp 846 } 847 req, _ := c.DescribeNatGatewaysRequest(inCpy) 848 req.SetContext(ctx) 849 req.ApplyOptions(opts...) 850 return req, nil 851 }, 852 } 853 w.ApplyOptions(opts...) 854 855 return w.WaitWithContext(ctx) 856} 857 858// WaitUntilNetworkInterfaceAvailable uses the Amazon EC2 API operation 859// DescribeNetworkInterfaces to wait for a condition to be met before returning. 860// If the condition is not met within the max attempt window, an error will 861// be returned. 862func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterfacesInput) error { 863 return c.WaitUntilNetworkInterfaceAvailableWithContext(aws.BackgroundContext(), input) 864} 865 866// WaitUntilNetworkInterfaceAvailableWithContext is an extended version of WaitUntilNetworkInterfaceAvailable. 867// With the support for passing in a context and options to configure the 868// Waiter and the underlying request options. 869// 870// The context must be non-nil and will be used for request cancellation. If 871// the context is nil a panic will occur. In the future the SDK may create 872// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 873// for more information on using Contexts. 874func (c *EC2) WaitUntilNetworkInterfaceAvailableWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, opts ...request.WaiterOption) error { 875 w := request.Waiter{ 876 Name: "WaitUntilNetworkInterfaceAvailable", 877 MaxAttempts: 10, 878 Delay: request.ConstantWaiterDelay(20 * time.Second), 879 Acceptors: []request.WaiterAcceptor{ 880 { 881 State: request.SuccessWaiterState, 882 Matcher: request.PathAllWaiterMatch, Argument: "NetworkInterfaces[].Status", 883 Expected: "available", 884 }, 885 { 886 State: request.FailureWaiterState, 887 Matcher: request.ErrorWaiterMatch, 888 Expected: "InvalidNetworkInterfaceID.NotFound", 889 }, 890 }, 891 Logger: c.Config.Logger, 892 NewRequest: func(opts []request.Option) (*request.Request, error) { 893 var inCpy *DescribeNetworkInterfacesInput 894 if input != nil { 895 tmp := *input 896 inCpy = &tmp 897 } 898 req, _ := c.DescribeNetworkInterfacesRequest(inCpy) 899 req.SetContext(ctx) 900 req.ApplyOptions(opts...) 901 return req, nil 902 }, 903 } 904 w.ApplyOptions(opts...) 905 906 return w.WaitWithContext(ctx) 907} 908 909// WaitUntilPasswordDataAvailable uses the Amazon EC2 API operation 910// GetPasswordData to wait for a condition to be met before returning. 911// If the condition is not met within the max attempt window, an error will 912// be returned. 913func (c *EC2) WaitUntilPasswordDataAvailable(input *GetPasswordDataInput) error { 914 return c.WaitUntilPasswordDataAvailableWithContext(aws.BackgroundContext(), input) 915} 916 917// WaitUntilPasswordDataAvailableWithContext is an extended version of WaitUntilPasswordDataAvailable. 918// With the support for passing in a context and options to configure the 919// Waiter and the underlying request options. 920// 921// The context must be non-nil and will be used for request cancellation. If 922// the context is nil a panic will occur. In the future the SDK may create 923// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 924// for more information on using Contexts. 925func (c *EC2) WaitUntilPasswordDataAvailableWithContext(ctx aws.Context, input *GetPasswordDataInput, opts ...request.WaiterOption) error { 926 w := request.Waiter{ 927 Name: "WaitUntilPasswordDataAvailable", 928 MaxAttempts: 40, 929 Delay: request.ConstantWaiterDelay(15 * time.Second), 930 Acceptors: []request.WaiterAcceptor{ 931 { 932 State: request.SuccessWaiterState, 933 Matcher: request.PathWaiterMatch, Argument: "length(PasswordData) > `0`", 934 Expected: true, 935 }, 936 }, 937 Logger: c.Config.Logger, 938 NewRequest: func(opts []request.Option) (*request.Request, error) { 939 var inCpy *GetPasswordDataInput 940 if input != nil { 941 tmp := *input 942 inCpy = &tmp 943 } 944 req, _ := c.GetPasswordDataRequest(inCpy) 945 req.SetContext(ctx) 946 req.ApplyOptions(opts...) 947 return req, nil 948 }, 949 } 950 w.ApplyOptions(opts...) 951 952 return w.WaitWithContext(ctx) 953} 954 955// WaitUntilSnapshotCompleted uses the Amazon EC2 API operation 956// DescribeSnapshots to wait for a condition to be met before returning. 957// If the condition is not met within the max attempt window, an error will 958// be returned. 959func (c *EC2) WaitUntilSnapshotCompleted(input *DescribeSnapshotsInput) error { 960 return c.WaitUntilSnapshotCompletedWithContext(aws.BackgroundContext(), input) 961} 962 963// WaitUntilSnapshotCompletedWithContext is an extended version of WaitUntilSnapshotCompleted. 964// With the support for passing in a context and options to configure the 965// Waiter and the underlying request options. 966// 967// The context must be non-nil and will be used for request cancellation. If 968// the context is nil a panic will occur. In the future the SDK may create 969// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 970// for more information on using Contexts. 971func (c *EC2) WaitUntilSnapshotCompletedWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.WaiterOption) error { 972 w := request.Waiter{ 973 Name: "WaitUntilSnapshotCompleted", 974 MaxAttempts: 40, 975 Delay: request.ConstantWaiterDelay(15 * time.Second), 976 Acceptors: []request.WaiterAcceptor{ 977 { 978 State: request.SuccessWaiterState, 979 Matcher: request.PathAllWaiterMatch, Argument: "Snapshots[].State", 980 Expected: "completed", 981 }, 982 }, 983 Logger: c.Config.Logger, 984 NewRequest: func(opts []request.Option) (*request.Request, error) { 985 var inCpy *DescribeSnapshotsInput 986 if input != nil { 987 tmp := *input 988 inCpy = &tmp 989 } 990 req, _ := c.DescribeSnapshotsRequest(inCpy) 991 req.SetContext(ctx) 992 req.ApplyOptions(opts...) 993 return req, nil 994 }, 995 } 996 w.ApplyOptions(opts...) 997 998 return w.WaitWithContext(ctx) 999} 1000 1001// WaitUntilSpotInstanceRequestFulfilled uses the Amazon EC2 API operation 1002// DescribeSpotInstanceRequests to wait for a condition to be met before returning. 1003// If the condition is not met within the max attempt window, an error will 1004// be returned. 1005func (c *EC2) WaitUntilSpotInstanceRequestFulfilled(input *DescribeSpotInstanceRequestsInput) error { 1006 return c.WaitUntilSpotInstanceRequestFulfilledWithContext(aws.BackgroundContext(), input) 1007} 1008 1009// WaitUntilSpotInstanceRequestFulfilledWithContext is an extended version of WaitUntilSpotInstanceRequestFulfilled. 1010// With the support for passing in a context and options to configure the 1011// Waiter and the underlying request options. 1012// 1013// The context must be non-nil and will be used for request cancellation. If 1014// the context is nil a panic will occur. In the future the SDK may create 1015// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1016// for more information on using Contexts. 1017func (c *EC2) WaitUntilSpotInstanceRequestFulfilledWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, opts ...request.WaiterOption) error { 1018 w := request.Waiter{ 1019 Name: "WaitUntilSpotInstanceRequestFulfilled", 1020 MaxAttempts: 40, 1021 Delay: request.ConstantWaiterDelay(15 * time.Second), 1022 Acceptors: []request.WaiterAcceptor{ 1023 { 1024 State: request.SuccessWaiterState, 1025 Matcher: request.PathAllWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", 1026 Expected: "fulfilled", 1027 }, 1028 { 1029 State: request.SuccessWaiterState, 1030 Matcher: request.PathAllWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", 1031 Expected: "request-canceled-and-instance-running", 1032 }, 1033 { 1034 State: request.FailureWaiterState, 1035 Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", 1036 Expected: "schedule-expired", 1037 }, 1038 { 1039 State: request.FailureWaiterState, 1040 Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", 1041 Expected: "canceled-before-fulfillment", 1042 }, 1043 { 1044 State: request.FailureWaiterState, 1045 Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", 1046 Expected: "bad-parameters", 1047 }, 1048 { 1049 State: request.FailureWaiterState, 1050 Matcher: request.PathAnyWaiterMatch, Argument: "SpotInstanceRequests[].Status.Code", 1051 Expected: "system-error", 1052 }, 1053 { 1054 State: request.RetryWaiterState, 1055 Matcher: request.ErrorWaiterMatch, 1056 Expected: "InvalidSpotInstanceRequestID.NotFound", 1057 }, 1058 }, 1059 Logger: c.Config.Logger, 1060 NewRequest: func(opts []request.Option) (*request.Request, error) { 1061 var inCpy *DescribeSpotInstanceRequestsInput 1062 if input != nil { 1063 tmp := *input 1064 inCpy = &tmp 1065 } 1066 req, _ := c.DescribeSpotInstanceRequestsRequest(inCpy) 1067 req.SetContext(ctx) 1068 req.ApplyOptions(opts...) 1069 return req, nil 1070 }, 1071 } 1072 w.ApplyOptions(opts...) 1073 1074 return w.WaitWithContext(ctx) 1075} 1076 1077// WaitUntilSubnetAvailable uses the Amazon EC2 API operation 1078// DescribeSubnets to wait for a condition to be met before returning. 1079// If the condition is not met within the max attempt window, an error will 1080// be returned. 1081func (c *EC2) WaitUntilSubnetAvailable(input *DescribeSubnetsInput) error { 1082 return c.WaitUntilSubnetAvailableWithContext(aws.BackgroundContext(), input) 1083} 1084 1085// WaitUntilSubnetAvailableWithContext is an extended version of WaitUntilSubnetAvailable. 1086// With the support for passing in a context and options to configure the 1087// Waiter and the underlying request options. 1088// 1089// The context must be non-nil and will be used for request cancellation. If 1090// the context is nil a panic will occur. In the future the SDK may create 1091// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1092// for more information on using Contexts. 1093func (c *EC2) WaitUntilSubnetAvailableWithContext(ctx aws.Context, input *DescribeSubnetsInput, opts ...request.WaiterOption) error { 1094 w := request.Waiter{ 1095 Name: "WaitUntilSubnetAvailable", 1096 MaxAttempts: 40, 1097 Delay: request.ConstantWaiterDelay(15 * time.Second), 1098 Acceptors: []request.WaiterAcceptor{ 1099 { 1100 State: request.SuccessWaiterState, 1101 Matcher: request.PathAllWaiterMatch, Argument: "Subnets[].State", 1102 Expected: "available", 1103 }, 1104 }, 1105 Logger: c.Config.Logger, 1106 NewRequest: func(opts []request.Option) (*request.Request, error) { 1107 var inCpy *DescribeSubnetsInput 1108 if input != nil { 1109 tmp := *input 1110 inCpy = &tmp 1111 } 1112 req, _ := c.DescribeSubnetsRequest(inCpy) 1113 req.SetContext(ctx) 1114 req.ApplyOptions(opts...) 1115 return req, nil 1116 }, 1117 } 1118 w.ApplyOptions(opts...) 1119 1120 return w.WaitWithContext(ctx) 1121} 1122 1123// WaitUntilSystemStatusOk uses the Amazon EC2 API operation 1124// DescribeInstanceStatus to wait for a condition to be met before returning. 1125// If the condition is not met within the max attempt window, an error will 1126// be returned. 1127func (c *EC2) WaitUntilSystemStatusOk(input *DescribeInstanceStatusInput) error { 1128 return c.WaitUntilSystemStatusOkWithContext(aws.BackgroundContext(), input) 1129} 1130 1131// WaitUntilSystemStatusOkWithContext is an extended version of WaitUntilSystemStatusOk. 1132// With the support for passing in a context and options to configure the 1133// Waiter and the underlying request options. 1134// 1135// The context must be non-nil and will be used for request cancellation. If 1136// the context is nil a panic will occur. In the future the SDK may create 1137// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1138// for more information on using Contexts. 1139func (c *EC2) WaitUntilSystemStatusOkWithContext(ctx aws.Context, input *DescribeInstanceStatusInput, opts ...request.WaiterOption) error { 1140 w := request.Waiter{ 1141 Name: "WaitUntilSystemStatusOk", 1142 MaxAttempts: 40, 1143 Delay: request.ConstantWaiterDelay(15 * time.Second), 1144 Acceptors: []request.WaiterAcceptor{ 1145 { 1146 State: request.SuccessWaiterState, 1147 Matcher: request.PathAllWaiterMatch, Argument: "InstanceStatuses[].SystemStatus.Status", 1148 Expected: "ok", 1149 }, 1150 }, 1151 Logger: c.Config.Logger, 1152 NewRequest: func(opts []request.Option) (*request.Request, error) { 1153 var inCpy *DescribeInstanceStatusInput 1154 if input != nil { 1155 tmp := *input 1156 inCpy = &tmp 1157 } 1158 req, _ := c.DescribeInstanceStatusRequest(inCpy) 1159 req.SetContext(ctx) 1160 req.ApplyOptions(opts...) 1161 return req, nil 1162 }, 1163 } 1164 w.ApplyOptions(opts...) 1165 1166 return w.WaitWithContext(ctx) 1167} 1168 1169// WaitUntilVolumeAvailable uses the Amazon EC2 API operation 1170// DescribeVolumes to wait for a condition to be met before returning. 1171// If the condition is not met within the max attempt window, an error will 1172// be returned. 1173func (c *EC2) WaitUntilVolumeAvailable(input *DescribeVolumesInput) error { 1174 return c.WaitUntilVolumeAvailableWithContext(aws.BackgroundContext(), input) 1175} 1176 1177// WaitUntilVolumeAvailableWithContext is an extended version of WaitUntilVolumeAvailable. 1178// With the support for passing in a context and options to configure the 1179// Waiter and the underlying request options. 1180// 1181// The context must be non-nil and will be used for request cancellation. If 1182// the context is nil a panic will occur. In the future the SDK may create 1183// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1184// for more information on using Contexts. 1185func (c *EC2) WaitUntilVolumeAvailableWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { 1186 w := request.Waiter{ 1187 Name: "WaitUntilVolumeAvailable", 1188 MaxAttempts: 40, 1189 Delay: request.ConstantWaiterDelay(15 * time.Second), 1190 Acceptors: []request.WaiterAcceptor{ 1191 { 1192 State: request.SuccessWaiterState, 1193 Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", 1194 Expected: "available", 1195 }, 1196 { 1197 State: request.FailureWaiterState, 1198 Matcher: request.PathAnyWaiterMatch, Argument: "Volumes[].State", 1199 Expected: "deleted", 1200 }, 1201 }, 1202 Logger: c.Config.Logger, 1203 NewRequest: func(opts []request.Option) (*request.Request, error) { 1204 var inCpy *DescribeVolumesInput 1205 if input != nil { 1206 tmp := *input 1207 inCpy = &tmp 1208 } 1209 req, _ := c.DescribeVolumesRequest(inCpy) 1210 req.SetContext(ctx) 1211 req.ApplyOptions(opts...) 1212 return req, nil 1213 }, 1214 } 1215 w.ApplyOptions(opts...) 1216 1217 return w.WaitWithContext(ctx) 1218} 1219 1220// WaitUntilVolumeDeleted uses the Amazon EC2 API operation 1221// DescribeVolumes to wait for a condition to be met before returning. 1222// If the condition is not met within the max attempt window, an error will 1223// be returned. 1224func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error { 1225 return c.WaitUntilVolumeDeletedWithContext(aws.BackgroundContext(), input) 1226} 1227 1228// WaitUntilVolumeDeletedWithContext is an extended version of WaitUntilVolumeDeleted. 1229// With the support for passing in a context and options to configure the 1230// Waiter and the underlying request options. 1231// 1232// The context must be non-nil and will be used for request cancellation. If 1233// the context is nil a panic will occur. In the future the SDK may create 1234// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1235// for more information on using Contexts. 1236func (c *EC2) WaitUntilVolumeDeletedWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { 1237 w := request.Waiter{ 1238 Name: "WaitUntilVolumeDeleted", 1239 MaxAttempts: 40, 1240 Delay: request.ConstantWaiterDelay(15 * time.Second), 1241 Acceptors: []request.WaiterAcceptor{ 1242 { 1243 State: request.SuccessWaiterState, 1244 Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", 1245 Expected: "deleted", 1246 }, 1247 { 1248 State: request.SuccessWaiterState, 1249 Matcher: request.ErrorWaiterMatch, 1250 Expected: "InvalidVolume.NotFound", 1251 }, 1252 }, 1253 Logger: c.Config.Logger, 1254 NewRequest: func(opts []request.Option) (*request.Request, error) { 1255 var inCpy *DescribeVolumesInput 1256 if input != nil { 1257 tmp := *input 1258 inCpy = &tmp 1259 } 1260 req, _ := c.DescribeVolumesRequest(inCpy) 1261 req.SetContext(ctx) 1262 req.ApplyOptions(opts...) 1263 return req, nil 1264 }, 1265 } 1266 w.ApplyOptions(opts...) 1267 1268 return w.WaitWithContext(ctx) 1269} 1270 1271// WaitUntilVolumeInUse uses the Amazon EC2 API operation 1272// DescribeVolumes to wait for a condition to be met before returning. 1273// If the condition is not met within the max attempt window, an error will 1274// be returned. 1275func (c *EC2) WaitUntilVolumeInUse(input *DescribeVolumesInput) error { 1276 return c.WaitUntilVolumeInUseWithContext(aws.BackgroundContext(), input) 1277} 1278 1279// WaitUntilVolumeInUseWithContext is an extended version of WaitUntilVolumeInUse. 1280// With the support for passing in a context and options to configure the 1281// Waiter and the underlying request options. 1282// 1283// The context must be non-nil and will be used for request cancellation. If 1284// the context is nil a panic will occur. In the future the SDK may create 1285// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1286// for more information on using Contexts. 1287func (c *EC2) WaitUntilVolumeInUseWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.WaiterOption) error { 1288 w := request.Waiter{ 1289 Name: "WaitUntilVolumeInUse", 1290 MaxAttempts: 40, 1291 Delay: request.ConstantWaiterDelay(15 * time.Second), 1292 Acceptors: []request.WaiterAcceptor{ 1293 { 1294 State: request.SuccessWaiterState, 1295 Matcher: request.PathAllWaiterMatch, Argument: "Volumes[].State", 1296 Expected: "in-use", 1297 }, 1298 { 1299 State: request.FailureWaiterState, 1300 Matcher: request.PathAnyWaiterMatch, Argument: "Volumes[].State", 1301 Expected: "deleted", 1302 }, 1303 }, 1304 Logger: c.Config.Logger, 1305 NewRequest: func(opts []request.Option) (*request.Request, error) { 1306 var inCpy *DescribeVolumesInput 1307 if input != nil { 1308 tmp := *input 1309 inCpy = &tmp 1310 } 1311 req, _ := c.DescribeVolumesRequest(inCpy) 1312 req.SetContext(ctx) 1313 req.ApplyOptions(opts...) 1314 return req, nil 1315 }, 1316 } 1317 w.ApplyOptions(opts...) 1318 1319 return w.WaitWithContext(ctx) 1320} 1321 1322// WaitUntilVpcAvailable uses the Amazon EC2 API operation 1323// DescribeVpcs to wait for a condition to be met before returning. 1324// If the condition is not met within the max attempt window, an error will 1325// be returned. 1326func (c *EC2) WaitUntilVpcAvailable(input *DescribeVpcsInput) error { 1327 return c.WaitUntilVpcAvailableWithContext(aws.BackgroundContext(), input) 1328} 1329 1330// WaitUntilVpcAvailableWithContext is an extended version of WaitUntilVpcAvailable. 1331// With the support for passing in a context and options to configure the 1332// Waiter and the underlying request options. 1333// 1334// The context must be non-nil and will be used for request cancellation. If 1335// the context is nil a panic will occur. In the future the SDK may create 1336// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1337// for more information on using Contexts. 1338func (c *EC2) WaitUntilVpcAvailableWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.WaiterOption) error { 1339 w := request.Waiter{ 1340 Name: "WaitUntilVpcAvailable", 1341 MaxAttempts: 40, 1342 Delay: request.ConstantWaiterDelay(15 * time.Second), 1343 Acceptors: []request.WaiterAcceptor{ 1344 { 1345 State: request.SuccessWaiterState, 1346 Matcher: request.PathAllWaiterMatch, Argument: "Vpcs[].State", 1347 Expected: "available", 1348 }, 1349 }, 1350 Logger: c.Config.Logger, 1351 NewRequest: func(opts []request.Option) (*request.Request, error) { 1352 var inCpy *DescribeVpcsInput 1353 if input != nil { 1354 tmp := *input 1355 inCpy = &tmp 1356 } 1357 req, _ := c.DescribeVpcsRequest(inCpy) 1358 req.SetContext(ctx) 1359 req.ApplyOptions(opts...) 1360 return req, nil 1361 }, 1362 } 1363 w.ApplyOptions(opts...) 1364 1365 return w.WaitWithContext(ctx) 1366} 1367 1368// WaitUntilVpcExists uses the Amazon EC2 API operation 1369// DescribeVpcs to wait for a condition to be met before returning. 1370// If the condition is not met within the max attempt window, an error will 1371// be returned. 1372func (c *EC2) WaitUntilVpcExists(input *DescribeVpcsInput) error { 1373 return c.WaitUntilVpcExistsWithContext(aws.BackgroundContext(), input) 1374} 1375 1376// WaitUntilVpcExistsWithContext is an extended version of WaitUntilVpcExists. 1377// With the support for passing in a context and options to configure the 1378// Waiter and the underlying request options. 1379// 1380// The context must be non-nil and will be used for request cancellation. If 1381// the context is nil a panic will occur. In the future the SDK may create 1382// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1383// for more information on using Contexts. 1384func (c *EC2) WaitUntilVpcExistsWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.WaiterOption) error { 1385 w := request.Waiter{ 1386 Name: "WaitUntilVpcExists", 1387 MaxAttempts: 5, 1388 Delay: request.ConstantWaiterDelay(1 * time.Second), 1389 Acceptors: []request.WaiterAcceptor{ 1390 { 1391 State: request.SuccessWaiterState, 1392 Matcher: request.StatusWaiterMatch, 1393 Expected: 200, 1394 }, 1395 { 1396 State: request.RetryWaiterState, 1397 Matcher: request.ErrorWaiterMatch, 1398 Expected: "InvalidVpcID.NotFound", 1399 }, 1400 }, 1401 Logger: c.Config.Logger, 1402 NewRequest: func(opts []request.Option) (*request.Request, error) { 1403 var inCpy *DescribeVpcsInput 1404 if input != nil { 1405 tmp := *input 1406 inCpy = &tmp 1407 } 1408 req, _ := c.DescribeVpcsRequest(inCpy) 1409 req.SetContext(ctx) 1410 req.ApplyOptions(opts...) 1411 return req, nil 1412 }, 1413 } 1414 w.ApplyOptions(opts...) 1415 1416 return w.WaitWithContext(ctx) 1417} 1418 1419// WaitUntilVpcPeeringConnectionDeleted uses the Amazon EC2 API operation 1420// DescribeVpcPeeringConnections to wait for a condition to be met before returning. 1421// If the condition is not met within the max attempt window, an error will 1422// be returned. 1423func (c *EC2) WaitUntilVpcPeeringConnectionDeleted(input *DescribeVpcPeeringConnectionsInput) error { 1424 return c.WaitUntilVpcPeeringConnectionDeletedWithContext(aws.BackgroundContext(), input) 1425} 1426 1427// WaitUntilVpcPeeringConnectionDeletedWithContext is an extended version of WaitUntilVpcPeeringConnectionDeleted. 1428// With the support for passing in a context and options to configure the 1429// Waiter and the underlying request options. 1430// 1431// The context must be non-nil and will be used for request cancellation. If 1432// the context is nil a panic will occur. In the future the SDK may create 1433// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1434// for more information on using Contexts. 1435func (c *EC2) WaitUntilVpcPeeringConnectionDeletedWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.WaiterOption) error { 1436 w := request.Waiter{ 1437 Name: "WaitUntilVpcPeeringConnectionDeleted", 1438 MaxAttempts: 40, 1439 Delay: request.ConstantWaiterDelay(15 * time.Second), 1440 Acceptors: []request.WaiterAcceptor{ 1441 { 1442 State: request.SuccessWaiterState, 1443 Matcher: request.PathAllWaiterMatch, Argument: "VpcPeeringConnections[].Status.Code", 1444 Expected: "deleted", 1445 }, 1446 { 1447 State: request.SuccessWaiterState, 1448 Matcher: request.ErrorWaiterMatch, 1449 Expected: "InvalidVpcPeeringConnectionID.NotFound", 1450 }, 1451 }, 1452 Logger: c.Config.Logger, 1453 NewRequest: func(opts []request.Option) (*request.Request, error) { 1454 var inCpy *DescribeVpcPeeringConnectionsInput 1455 if input != nil { 1456 tmp := *input 1457 inCpy = &tmp 1458 } 1459 req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) 1460 req.SetContext(ctx) 1461 req.ApplyOptions(opts...) 1462 return req, nil 1463 }, 1464 } 1465 w.ApplyOptions(opts...) 1466 1467 return w.WaitWithContext(ctx) 1468} 1469 1470// WaitUntilVpcPeeringConnectionExists uses the Amazon EC2 API operation 1471// DescribeVpcPeeringConnections to wait for a condition to be met before returning. 1472// If the condition is not met within the max attempt window, an error will 1473// be returned. 1474func (c *EC2) WaitUntilVpcPeeringConnectionExists(input *DescribeVpcPeeringConnectionsInput) error { 1475 return c.WaitUntilVpcPeeringConnectionExistsWithContext(aws.BackgroundContext(), input) 1476} 1477 1478// WaitUntilVpcPeeringConnectionExistsWithContext is an extended version of WaitUntilVpcPeeringConnectionExists. 1479// With the support for passing in a context and options to configure the 1480// Waiter and the underlying request options. 1481// 1482// The context must be non-nil and will be used for request cancellation. If 1483// the context is nil a panic will occur. In the future the SDK may create 1484// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1485// for more information on using Contexts. 1486func (c *EC2) WaitUntilVpcPeeringConnectionExistsWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.WaiterOption) error { 1487 w := request.Waiter{ 1488 Name: "WaitUntilVpcPeeringConnectionExists", 1489 MaxAttempts: 40, 1490 Delay: request.ConstantWaiterDelay(15 * time.Second), 1491 Acceptors: []request.WaiterAcceptor{ 1492 { 1493 State: request.SuccessWaiterState, 1494 Matcher: request.StatusWaiterMatch, 1495 Expected: 200, 1496 }, 1497 { 1498 State: request.RetryWaiterState, 1499 Matcher: request.ErrorWaiterMatch, 1500 Expected: "InvalidVpcPeeringConnectionID.NotFound", 1501 }, 1502 }, 1503 Logger: c.Config.Logger, 1504 NewRequest: func(opts []request.Option) (*request.Request, error) { 1505 var inCpy *DescribeVpcPeeringConnectionsInput 1506 if input != nil { 1507 tmp := *input 1508 inCpy = &tmp 1509 } 1510 req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) 1511 req.SetContext(ctx) 1512 req.ApplyOptions(opts...) 1513 return req, nil 1514 }, 1515 } 1516 w.ApplyOptions(opts...) 1517 1518 return w.WaitWithContext(ctx) 1519} 1520 1521// WaitUntilVpnConnectionAvailable uses the Amazon EC2 API operation 1522// DescribeVpnConnections to wait for a condition to be met before returning. 1523// If the condition is not met within the max attempt window, an error will 1524// be returned. 1525func (c *EC2) WaitUntilVpnConnectionAvailable(input *DescribeVpnConnectionsInput) error { 1526 return c.WaitUntilVpnConnectionAvailableWithContext(aws.BackgroundContext(), input) 1527} 1528 1529// WaitUntilVpnConnectionAvailableWithContext is an extended version of WaitUntilVpnConnectionAvailable. 1530// With the support for passing in a context and options to configure the 1531// Waiter and the underlying request options. 1532// 1533// The context must be non-nil and will be used for request cancellation. If 1534// the context is nil a panic will occur. In the future the SDK may create 1535// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1536// for more information on using Contexts. 1537func (c *EC2) WaitUntilVpnConnectionAvailableWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.WaiterOption) error { 1538 w := request.Waiter{ 1539 Name: "WaitUntilVpnConnectionAvailable", 1540 MaxAttempts: 40, 1541 Delay: request.ConstantWaiterDelay(15 * time.Second), 1542 Acceptors: []request.WaiterAcceptor{ 1543 { 1544 State: request.SuccessWaiterState, 1545 Matcher: request.PathAllWaiterMatch, Argument: "VpnConnections[].State", 1546 Expected: "available", 1547 }, 1548 { 1549 State: request.FailureWaiterState, 1550 Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", 1551 Expected: "deleting", 1552 }, 1553 { 1554 State: request.FailureWaiterState, 1555 Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", 1556 Expected: "deleted", 1557 }, 1558 }, 1559 Logger: c.Config.Logger, 1560 NewRequest: func(opts []request.Option) (*request.Request, error) { 1561 var inCpy *DescribeVpnConnectionsInput 1562 if input != nil { 1563 tmp := *input 1564 inCpy = &tmp 1565 } 1566 req, _ := c.DescribeVpnConnectionsRequest(inCpy) 1567 req.SetContext(ctx) 1568 req.ApplyOptions(opts...) 1569 return req, nil 1570 }, 1571 } 1572 w.ApplyOptions(opts...) 1573 1574 return w.WaitWithContext(ctx) 1575} 1576 1577// WaitUntilVpnConnectionDeleted uses the Amazon EC2 API operation 1578// DescribeVpnConnections to wait for a condition to be met before returning. 1579// If the condition is not met within the max attempt window, an error will 1580// be returned. 1581func (c *EC2) WaitUntilVpnConnectionDeleted(input *DescribeVpnConnectionsInput) error { 1582 return c.WaitUntilVpnConnectionDeletedWithContext(aws.BackgroundContext(), input) 1583} 1584 1585// WaitUntilVpnConnectionDeletedWithContext is an extended version of WaitUntilVpnConnectionDeleted. 1586// With the support for passing in a context and options to configure the 1587// Waiter and the underlying request options. 1588// 1589// The context must be non-nil and will be used for request cancellation. If 1590// the context is nil a panic will occur. In the future the SDK may create 1591// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 1592// for more information on using Contexts. 1593func (c *EC2) WaitUntilVpnConnectionDeletedWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.WaiterOption) error { 1594 w := request.Waiter{ 1595 Name: "WaitUntilVpnConnectionDeleted", 1596 MaxAttempts: 40, 1597 Delay: request.ConstantWaiterDelay(15 * time.Second), 1598 Acceptors: []request.WaiterAcceptor{ 1599 { 1600 State: request.SuccessWaiterState, 1601 Matcher: request.PathAllWaiterMatch, Argument: "VpnConnections[].State", 1602 Expected: "deleted", 1603 }, 1604 { 1605 State: request.FailureWaiterState, 1606 Matcher: request.PathAnyWaiterMatch, Argument: "VpnConnections[].State", 1607 Expected: "pending", 1608 }, 1609 }, 1610 Logger: c.Config.Logger, 1611 NewRequest: func(opts []request.Option) (*request.Request, error) { 1612 var inCpy *DescribeVpnConnectionsInput 1613 if input != nil { 1614 tmp := *input 1615 inCpy = &tmp 1616 } 1617 req, _ := c.DescribeVpnConnectionsRequest(inCpy) 1618 req.SetContext(ctx) 1619 req.ApplyOptions(opts...) 1620 return req, nil 1621 }, 1622 } 1623 w.ApplyOptions(opts...) 1624 1625 return w.WaitWithContext(ctx) 1626} 1627