waiters.go 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package ec2
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilBundleTaskComplete uses the Amazon EC2 API operation
  7. // DescribeBundleTasks to wait for a condition to be met before returning.
  8. // If the condition is not meet within the max attempt window an error will
  9. // be returned.
  10. func (c *EC2) WaitUntilBundleTaskComplete(input *DescribeBundleTasksInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "DescribeBundleTasks",
  13. Delay: 15,
  14. MaxAttempts: 40,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "pathAll",
  19. Argument: "BundleTasks[].State",
  20. Expected: "complete",
  21. },
  22. {
  23. State: "failure",
  24. Matcher: "pathAny",
  25. Argument: "BundleTasks[].State",
  26. Expected: "failed",
  27. },
  28. },
  29. }
  30. w := waiter.Waiter{
  31. Client: c,
  32. Input: input,
  33. Config: waiterCfg,
  34. }
  35. return w.Wait()
  36. }
  37. // WaitUntilConversionTaskCancelled uses the Amazon EC2 API operation
  38. // DescribeConversionTasks to wait for a condition to be met before returning.
  39. // If the condition is not meet within the max attempt window an error will
  40. // be returned.
  41. func (c *EC2) WaitUntilConversionTaskCancelled(input *DescribeConversionTasksInput) error {
  42. waiterCfg := waiter.Config{
  43. Operation: "DescribeConversionTasks",
  44. Delay: 15,
  45. MaxAttempts: 40,
  46. Acceptors: []waiter.WaitAcceptor{
  47. {
  48. State: "success",
  49. Matcher: "pathAll",
  50. Argument: "ConversionTasks[].State",
  51. Expected: "cancelled",
  52. },
  53. },
  54. }
  55. w := waiter.Waiter{
  56. Client: c,
  57. Input: input,
  58. Config: waiterCfg,
  59. }
  60. return w.Wait()
  61. }
  62. // WaitUntilConversionTaskCompleted uses the Amazon EC2 API operation
  63. // DescribeConversionTasks to wait for a condition to be met before returning.
  64. // If the condition is not meet within the max attempt window an error will
  65. // be returned.
  66. func (c *EC2) WaitUntilConversionTaskCompleted(input *DescribeConversionTasksInput) error {
  67. waiterCfg := waiter.Config{
  68. Operation: "DescribeConversionTasks",
  69. Delay: 15,
  70. MaxAttempts: 40,
  71. Acceptors: []waiter.WaitAcceptor{
  72. {
  73. State: "success",
  74. Matcher: "pathAll",
  75. Argument: "ConversionTasks[].State",
  76. Expected: "completed",
  77. },
  78. {
  79. State: "failure",
  80. Matcher: "pathAny",
  81. Argument: "ConversionTasks[].State",
  82. Expected: "cancelled",
  83. },
  84. {
  85. State: "failure",
  86. Matcher: "pathAny",
  87. Argument: "ConversionTasks[].State",
  88. Expected: "cancelling",
  89. },
  90. },
  91. }
  92. w := waiter.Waiter{
  93. Client: c,
  94. Input: input,
  95. Config: waiterCfg,
  96. }
  97. return w.Wait()
  98. }
  99. // WaitUntilConversionTaskDeleted uses the Amazon EC2 API operation
  100. // DescribeConversionTasks to wait for a condition to be met before returning.
  101. // If the condition is not meet within the max attempt window an error will
  102. // be returned.
  103. func (c *EC2) WaitUntilConversionTaskDeleted(input *DescribeConversionTasksInput) error {
  104. waiterCfg := waiter.Config{
  105. Operation: "DescribeConversionTasks",
  106. Delay: 15,
  107. MaxAttempts: 40,
  108. Acceptors: []waiter.WaitAcceptor{
  109. {
  110. State: "success",
  111. Matcher: "pathAll",
  112. Argument: "ConversionTasks[].State",
  113. Expected: "deleted",
  114. },
  115. },
  116. }
  117. w := waiter.Waiter{
  118. Client: c,
  119. Input: input,
  120. Config: waiterCfg,
  121. }
  122. return w.Wait()
  123. }
  124. // WaitUntilCustomerGatewayAvailable uses the Amazon EC2 API operation
  125. // DescribeCustomerGateways to wait for a condition to be met before returning.
  126. // If the condition is not meet within the max attempt window an error will
  127. // be returned.
  128. func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysInput) error {
  129. waiterCfg := waiter.Config{
  130. Operation: "DescribeCustomerGateways",
  131. Delay: 15,
  132. MaxAttempts: 40,
  133. Acceptors: []waiter.WaitAcceptor{
  134. {
  135. State: "success",
  136. Matcher: "pathAll",
  137. Argument: "CustomerGateways[].State",
  138. Expected: "available",
  139. },
  140. {
  141. State: "failure",
  142. Matcher: "pathAny",
  143. Argument: "CustomerGateways[].State",
  144. Expected: "deleted",
  145. },
  146. {
  147. State: "failure",
  148. Matcher: "pathAny",
  149. Argument: "CustomerGateways[].State",
  150. Expected: "deleting",
  151. },
  152. },
  153. }
  154. w := waiter.Waiter{
  155. Client: c,
  156. Input: input,
  157. Config: waiterCfg,
  158. }
  159. return w.Wait()
  160. }
  161. // WaitUntilExportTaskCancelled uses the Amazon EC2 API operation
  162. // DescribeExportTasks to wait for a condition to be met before returning.
  163. // If the condition is not meet within the max attempt window an error will
  164. // be returned.
  165. func (c *EC2) WaitUntilExportTaskCancelled(input *DescribeExportTasksInput) error {
  166. waiterCfg := waiter.Config{
  167. Operation: "DescribeExportTasks",
  168. Delay: 15,
  169. MaxAttempts: 40,
  170. Acceptors: []waiter.WaitAcceptor{
  171. {
  172. State: "success",
  173. Matcher: "pathAll",
  174. Argument: "ExportTasks[].State",
  175. Expected: "cancelled",
  176. },
  177. },
  178. }
  179. w := waiter.Waiter{
  180. Client: c,
  181. Input: input,
  182. Config: waiterCfg,
  183. }
  184. return w.Wait()
  185. }
  186. // WaitUntilExportTaskCompleted uses the Amazon EC2 API operation
  187. // DescribeExportTasks to wait for a condition to be met before returning.
  188. // If the condition is not meet within the max attempt window an error will
  189. // be returned.
  190. func (c *EC2) WaitUntilExportTaskCompleted(input *DescribeExportTasksInput) error {
  191. waiterCfg := waiter.Config{
  192. Operation: "DescribeExportTasks",
  193. Delay: 15,
  194. MaxAttempts: 40,
  195. Acceptors: []waiter.WaitAcceptor{
  196. {
  197. State: "success",
  198. Matcher: "pathAll",
  199. Argument: "ExportTasks[].State",
  200. Expected: "completed",
  201. },
  202. },
  203. }
  204. w := waiter.Waiter{
  205. Client: c,
  206. Input: input,
  207. Config: waiterCfg,
  208. }
  209. return w.Wait()
  210. }
  211. // WaitUntilImageAvailable uses the Amazon EC2 API operation
  212. // DescribeImages to wait for a condition to be met before returning.
  213. // If the condition is not meet within the max attempt window an error will
  214. // be returned.
  215. func (c *EC2) WaitUntilImageAvailable(input *DescribeImagesInput) error {
  216. waiterCfg := waiter.Config{
  217. Operation: "DescribeImages",
  218. Delay: 15,
  219. MaxAttempts: 40,
  220. Acceptors: []waiter.WaitAcceptor{
  221. {
  222. State: "success",
  223. Matcher: "pathAll",
  224. Argument: "Images[].State",
  225. Expected: "available",
  226. },
  227. {
  228. State: "failure",
  229. Matcher: "pathAny",
  230. Argument: "Images[].State",
  231. Expected: "failed",
  232. },
  233. },
  234. }
  235. w := waiter.Waiter{
  236. Client: c,
  237. Input: input,
  238. Config: waiterCfg,
  239. }
  240. return w.Wait()
  241. }
  242. // WaitUntilImageExists uses the Amazon EC2 API operation
  243. // DescribeImages to wait for a condition to be met before returning.
  244. // If the condition is not meet within the max attempt window an error will
  245. // be returned.
  246. func (c *EC2) WaitUntilImageExists(input *DescribeImagesInput) error {
  247. waiterCfg := waiter.Config{
  248. Operation: "DescribeImages",
  249. Delay: 15,
  250. MaxAttempts: 40,
  251. Acceptors: []waiter.WaitAcceptor{
  252. {
  253. State: "success",
  254. Matcher: "path",
  255. Argument: "length(Images[]) > `0`",
  256. Expected: true,
  257. },
  258. {
  259. State: "retry",
  260. Matcher: "error",
  261. Argument: "",
  262. Expected: "InvalidAMIID.NotFound",
  263. },
  264. },
  265. }
  266. w := waiter.Waiter{
  267. Client: c,
  268. Input: input,
  269. Config: waiterCfg,
  270. }
  271. return w.Wait()
  272. }
  273. // WaitUntilInstanceExists uses the Amazon EC2 API operation
  274. // DescribeInstances to wait for a condition to be met before returning.
  275. // If the condition is not meet within the max attempt window an error will
  276. // be returned.
  277. func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error {
  278. waiterCfg := waiter.Config{
  279. Operation: "DescribeInstances",
  280. Delay: 5,
  281. MaxAttempts: 40,
  282. Acceptors: []waiter.WaitAcceptor{
  283. {
  284. State: "success",
  285. Matcher: "path",
  286. Argument: "length(Reservations[]) > `0`",
  287. Expected: true,
  288. },
  289. {
  290. State: "retry",
  291. Matcher: "error",
  292. Argument: "",
  293. Expected: "InvalidInstanceID.NotFound",
  294. },
  295. },
  296. }
  297. w := waiter.Waiter{
  298. Client: c,
  299. Input: input,
  300. Config: waiterCfg,
  301. }
  302. return w.Wait()
  303. }
  304. // WaitUntilInstanceRunning uses the Amazon EC2 API operation
  305. // DescribeInstances to wait for a condition to be met before returning.
  306. // If the condition is not meet within the max attempt window an error will
  307. // be returned.
  308. func (c *EC2) WaitUntilInstanceRunning(input *DescribeInstancesInput) error {
  309. waiterCfg := waiter.Config{
  310. Operation: "DescribeInstances",
  311. Delay: 15,
  312. MaxAttempts: 40,
  313. Acceptors: []waiter.WaitAcceptor{
  314. {
  315. State: "success",
  316. Matcher: "pathAll",
  317. Argument: "Reservations[].Instances[].State.Name",
  318. Expected: "running",
  319. },
  320. {
  321. State: "failure",
  322. Matcher: "pathAny",
  323. Argument: "Reservations[].Instances[].State.Name",
  324. Expected: "shutting-down",
  325. },
  326. {
  327. State: "failure",
  328. Matcher: "pathAny",
  329. Argument: "Reservations[].Instances[].State.Name",
  330. Expected: "terminated",
  331. },
  332. {
  333. State: "failure",
  334. Matcher: "pathAny",
  335. Argument: "Reservations[].Instances[].State.Name",
  336. Expected: "stopping",
  337. },
  338. {
  339. State: "retry",
  340. Matcher: "error",
  341. Argument: "",
  342. Expected: "InvalidInstanceID.NotFound",
  343. },
  344. },
  345. }
  346. w := waiter.Waiter{
  347. Client: c,
  348. Input: input,
  349. Config: waiterCfg,
  350. }
  351. return w.Wait()
  352. }
  353. // WaitUntilInstanceStatusOk uses the Amazon EC2 API operation
  354. // DescribeInstanceStatus to wait for a condition to be met before returning.
  355. // If the condition is not meet within the max attempt window an error will
  356. // be returned.
  357. func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) error {
  358. waiterCfg := waiter.Config{
  359. Operation: "DescribeInstanceStatus",
  360. Delay: 15,
  361. MaxAttempts: 40,
  362. Acceptors: []waiter.WaitAcceptor{
  363. {
  364. State: "success",
  365. Matcher: "pathAll",
  366. Argument: "InstanceStatuses[].InstanceStatus.Status",
  367. Expected: "ok",
  368. },
  369. {
  370. State: "retry",
  371. Matcher: "error",
  372. Argument: "",
  373. Expected: "InvalidInstanceID.NotFound",
  374. },
  375. },
  376. }
  377. w := waiter.Waiter{
  378. Client: c,
  379. Input: input,
  380. Config: waiterCfg,
  381. }
  382. return w.Wait()
  383. }
  384. // WaitUntilInstanceStopped uses the Amazon EC2 API operation
  385. // DescribeInstances to wait for a condition to be met before returning.
  386. // If the condition is not meet within the max attempt window an error will
  387. // be returned.
  388. func (c *EC2) WaitUntilInstanceStopped(input *DescribeInstancesInput) error {
  389. waiterCfg := waiter.Config{
  390. Operation: "DescribeInstances",
  391. Delay: 15,
  392. MaxAttempts: 40,
  393. Acceptors: []waiter.WaitAcceptor{
  394. {
  395. State: "success",
  396. Matcher: "pathAll",
  397. Argument: "Reservations[].Instances[].State.Name",
  398. Expected: "stopped",
  399. },
  400. {
  401. State: "failure",
  402. Matcher: "pathAny",
  403. Argument: "Reservations[].Instances[].State.Name",
  404. Expected: "pending",
  405. },
  406. {
  407. State: "failure",
  408. Matcher: "pathAny",
  409. Argument: "Reservations[].Instances[].State.Name",
  410. Expected: "terminated",
  411. },
  412. },
  413. }
  414. w := waiter.Waiter{
  415. Client: c,
  416. Input: input,
  417. Config: waiterCfg,
  418. }
  419. return w.Wait()
  420. }
  421. // WaitUntilInstanceTerminated uses the Amazon EC2 API operation
  422. // DescribeInstances to wait for a condition to be met before returning.
  423. // If the condition is not meet within the max attempt window an error will
  424. // be returned.
  425. func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error {
  426. waiterCfg := waiter.Config{
  427. Operation: "DescribeInstances",
  428. Delay: 15,
  429. MaxAttempts: 40,
  430. Acceptors: []waiter.WaitAcceptor{
  431. {
  432. State: "success",
  433. Matcher: "pathAll",
  434. Argument: "Reservations[].Instances[].State.Name",
  435. Expected: "terminated",
  436. },
  437. {
  438. State: "failure",
  439. Matcher: "pathAny",
  440. Argument: "Reservations[].Instances[].State.Name",
  441. Expected: "pending",
  442. },
  443. {
  444. State: "failure",
  445. Matcher: "pathAny",
  446. Argument: "Reservations[].Instances[].State.Name",
  447. Expected: "stopping",
  448. },
  449. },
  450. }
  451. w := waiter.Waiter{
  452. Client: c,
  453. Input: input,
  454. Config: waiterCfg,
  455. }
  456. return w.Wait()
  457. }
  458. // WaitUntilKeyPairExists uses the Amazon EC2 API operation
  459. // DescribeKeyPairs to wait for a condition to be met before returning.
  460. // If the condition is not meet within the max attempt window an error will
  461. // be returned.
  462. func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error {
  463. waiterCfg := waiter.Config{
  464. Operation: "DescribeKeyPairs",
  465. Delay: 5,
  466. MaxAttempts: 6,
  467. Acceptors: []waiter.WaitAcceptor{
  468. {
  469. State: "success",
  470. Matcher: "pathAll",
  471. Argument: "length(KeyPairs[].KeyName) > `0`",
  472. Expected: true,
  473. },
  474. {
  475. State: "retry",
  476. Matcher: "error",
  477. Argument: "",
  478. Expected: "InvalidKeyPair.NotFound",
  479. },
  480. },
  481. }
  482. w := waiter.Waiter{
  483. Client: c,
  484. Input: input,
  485. Config: waiterCfg,
  486. }
  487. return w.Wait()
  488. }
  489. // WaitUntilNatGatewayAvailable uses the Amazon EC2 API operation
  490. // DescribeNatGateways to wait for a condition to be met before returning.
  491. // If the condition is not meet within the max attempt window an error will
  492. // be returned.
  493. func (c *EC2) WaitUntilNatGatewayAvailable(input *DescribeNatGatewaysInput) error {
  494. waiterCfg := waiter.Config{
  495. Operation: "DescribeNatGateways",
  496. Delay: 15,
  497. MaxAttempts: 40,
  498. Acceptors: []waiter.WaitAcceptor{
  499. {
  500. State: "success",
  501. Matcher: "pathAll",
  502. Argument: "NatGateways[].State",
  503. Expected: "available",
  504. },
  505. {
  506. State: "failure",
  507. Matcher: "pathAny",
  508. Argument: "NatGateways[].State",
  509. Expected: "failed",
  510. },
  511. {
  512. State: "failure",
  513. Matcher: "pathAny",
  514. Argument: "NatGateways[].State",
  515. Expected: "deleting",
  516. },
  517. {
  518. State: "failure",
  519. Matcher: "pathAny",
  520. Argument: "NatGateways[].State",
  521. Expected: "deleted",
  522. },
  523. {
  524. State: "retry",
  525. Matcher: "error",
  526. Argument: "",
  527. Expected: "NatGatewayNotFound",
  528. },
  529. },
  530. }
  531. w := waiter.Waiter{
  532. Client: c,
  533. Input: input,
  534. Config: waiterCfg,
  535. }
  536. return w.Wait()
  537. }
  538. // WaitUntilNetworkInterfaceAvailable uses the Amazon EC2 API operation
  539. // DescribeNetworkInterfaces to wait for a condition to be met before returning.
  540. // If the condition is not meet within the max attempt window an error will
  541. // be returned.
  542. func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterfacesInput) error {
  543. waiterCfg := waiter.Config{
  544. Operation: "DescribeNetworkInterfaces",
  545. Delay: 20,
  546. MaxAttempts: 10,
  547. Acceptors: []waiter.WaitAcceptor{
  548. {
  549. State: "success",
  550. Matcher: "pathAll",
  551. Argument: "NetworkInterfaces[].Status",
  552. Expected: "available",
  553. },
  554. {
  555. State: "failure",
  556. Matcher: "error",
  557. Argument: "",
  558. Expected: "InvalidNetworkInterfaceID.NotFound",
  559. },
  560. },
  561. }
  562. w := waiter.Waiter{
  563. Client: c,
  564. Input: input,
  565. Config: waiterCfg,
  566. }
  567. return w.Wait()
  568. }
  569. // WaitUntilPasswordDataAvailable uses the Amazon EC2 API operation
  570. // GetPasswordData to wait for a condition to be met before returning.
  571. // If the condition is not meet within the max attempt window an error will
  572. // be returned.
  573. func (c *EC2) WaitUntilPasswordDataAvailable(input *GetPasswordDataInput) error {
  574. waiterCfg := waiter.Config{
  575. Operation: "GetPasswordData",
  576. Delay: 15,
  577. MaxAttempts: 40,
  578. Acceptors: []waiter.WaitAcceptor{
  579. {
  580. State: "success",
  581. Matcher: "path",
  582. Argument: "length(PasswordData) > `0`",
  583. Expected: true,
  584. },
  585. },
  586. }
  587. w := waiter.Waiter{
  588. Client: c,
  589. Input: input,
  590. Config: waiterCfg,
  591. }
  592. return w.Wait()
  593. }
  594. // WaitUntilSnapshotCompleted uses the Amazon EC2 API operation
  595. // DescribeSnapshots to wait for a condition to be met before returning.
  596. // If the condition is not meet within the max attempt window an error will
  597. // be returned.
  598. func (c *EC2) WaitUntilSnapshotCompleted(input *DescribeSnapshotsInput) error {
  599. waiterCfg := waiter.Config{
  600. Operation: "DescribeSnapshots",
  601. Delay: 15,
  602. MaxAttempts: 40,
  603. Acceptors: []waiter.WaitAcceptor{
  604. {
  605. State: "success",
  606. Matcher: "pathAll",
  607. Argument: "Snapshots[].State",
  608. Expected: "completed",
  609. },
  610. },
  611. }
  612. w := waiter.Waiter{
  613. Client: c,
  614. Input: input,
  615. Config: waiterCfg,
  616. }
  617. return w.Wait()
  618. }
  619. // WaitUntilSpotInstanceRequestFulfilled uses the Amazon EC2 API operation
  620. // DescribeSpotInstanceRequests to wait for a condition to be met before returning.
  621. // If the condition is not meet within the max attempt window an error will
  622. // be returned.
  623. func (c *EC2) WaitUntilSpotInstanceRequestFulfilled(input *DescribeSpotInstanceRequestsInput) error {
  624. waiterCfg := waiter.Config{
  625. Operation: "DescribeSpotInstanceRequests",
  626. Delay: 15,
  627. MaxAttempts: 40,
  628. Acceptors: []waiter.WaitAcceptor{
  629. {
  630. State: "success",
  631. Matcher: "pathAll",
  632. Argument: "SpotInstanceRequests[].Status.Code",
  633. Expected: "fulfilled",
  634. },
  635. {
  636. State: "failure",
  637. Matcher: "pathAny",
  638. Argument: "SpotInstanceRequests[].Status.Code",
  639. Expected: "schedule-expired",
  640. },
  641. {
  642. State: "failure",
  643. Matcher: "pathAny",
  644. Argument: "SpotInstanceRequests[].Status.Code",
  645. Expected: "canceled-before-fulfillment",
  646. },
  647. {
  648. State: "failure",
  649. Matcher: "pathAny",
  650. Argument: "SpotInstanceRequests[].Status.Code",
  651. Expected: "bad-parameters",
  652. },
  653. {
  654. State: "failure",
  655. Matcher: "pathAny",
  656. Argument: "SpotInstanceRequests[].Status.Code",
  657. Expected: "system-error",
  658. },
  659. },
  660. }
  661. w := waiter.Waiter{
  662. Client: c,
  663. Input: input,
  664. Config: waiterCfg,
  665. }
  666. return w.Wait()
  667. }
  668. // WaitUntilSubnetAvailable uses the Amazon EC2 API operation
  669. // DescribeSubnets to wait for a condition to be met before returning.
  670. // If the condition is not meet within the max attempt window an error will
  671. // be returned.
  672. func (c *EC2) WaitUntilSubnetAvailable(input *DescribeSubnetsInput) error {
  673. waiterCfg := waiter.Config{
  674. Operation: "DescribeSubnets",
  675. Delay: 15,
  676. MaxAttempts: 40,
  677. Acceptors: []waiter.WaitAcceptor{
  678. {
  679. State: "success",
  680. Matcher: "pathAll",
  681. Argument: "Subnets[].State",
  682. Expected: "available",
  683. },
  684. },
  685. }
  686. w := waiter.Waiter{
  687. Client: c,
  688. Input: input,
  689. Config: waiterCfg,
  690. }
  691. return w.Wait()
  692. }
  693. // WaitUntilSystemStatusOk uses the Amazon EC2 API operation
  694. // DescribeInstanceStatus to wait for a condition to be met before returning.
  695. // If the condition is not meet within the max attempt window an error will
  696. // be returned.
  697. func (c *EC2) WaitUntilSystemStatusOk(input *DescribeInstanceStatusInput) error {
  698. waiterCfg := waiter.Config{
  699. Operation: "DescribeInstanceStatus",
  700. Delay: 15,
  701. MaxAttempts: 40,
  702. Acceptors: []waiter.WaitAcceptor{
  703. {
  704. State: "success",
  705. Matcher: "pathAll",
  706. Argument: "InstanceStatuses[].SystemStatus.Status",
  707. Expected: "ok",
  708. },
  709. },
  710. }
  711. w := waiter.Waiter{
  712. Client: c,
  713. Input: input,
  714. Config: waiterCfg,
  715. }
  716. return w.Wait()
  717. }
  718. // WaitUntilVolumeAvailable uses the Amazon EC2 API operation
  719. // DescribeVolumes to wait for a condition to be met before returning.
  720. // If the condition is not meet within the max attempt window an error will
  721. // be returned.
  722. func (c *EC2) WaitUntilVolumeAvailable(input *DescribeVolumesInput) error {
  723. waiterCfg := waiter.Config{
  724. Operation: "DescribeVolumes",
  725. Delay: 15,
  726. MaxAttempts: 40,
  727. Acceptors: []waiter.WaitAcceptor{
  728. {
  729. State: "success",
  730. Matcher: "pathAll",
  731. Argument: "Volumes[].State",
  732. Expected: "available",
  733. },
  734. {
  735. State: "failure",
  736. Matcher: "pathAny",
  737. Argument: "Volumes[].State",
  738. Expected: "deleted",
  739. },
  740. },
  741. }
  742. w := waiter.Waiter{
  743. Client: c,
  744. Input: input,
  745. Config: waiterCfg,
  746. }
  747. return w.Wait()
  748. }
  749. // WaitUntilVolumeDeleted uses the Amazon EC2 API operation
  750. // DescribeVolumes to wait for a condition to be met before returning.
  751. // If the condition is not meet within the max attempt window an error will
  752. // be returned.
  753. func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error {
  754. waiterCfg := waiter.Config{
  755. Operation: "DescribeVolumes",
  756. Delay: 15,
  757. MaxAttempts: 40,
  758. Acceptors: []waiter.WaitAcceptor{
  759. {
  760. State: "success",
  761. Matcher: "pathAll",
  762. Argument: "Volumes[].State",
  763. Expected: "deleted",
  764. },
  765. {
  766. State: "success",
  767. Matcher: "error",
  768. Argument: "",
  769. Expected: "InvalidVolume.NotFound",
  770. },
  771. },
  772. }
  773. w := waiter.Waiter{
  774. Client: c,
  775. Input: input,
  776. Config: waiterCfg,
  777. }
  778. return w.Wait()
  779. }
  780. // WaitUntilVolumeInUse uses the Amazon EC2 API operation
  781. // DescribeVolumes to wait for a condition to be met before returning.
  782. // If the condition is not meet within the max attempt window an error will
  783. // be returned.
  784. func (c *EC2) WaitUntilVolumeInUse(input *DescribeVolumesInput) error {
  785. waiterCfg := waiter.Config{
  786. Operation: "DescribeVolumes",
  787. Delay: 15,
  788. MaxAttempts: 40,
  789. Acceptors: []waiter.WaitAcceptor{
  790. {
  791. State: "success",
  792. Matcher: "pathAll",
  793. Argument: "Volumes[].State",
  794. Expected: "in-use",
  795. },
  796. {
  797. State: "failure",
  798. Matcher: "pathAny",
  799. Argument: "Volumes[].State",
  800. Expected: "deleted",
  801. },
  802. },
  803. }
  804. w := waiter.Waiter{
  805. Client: c,
  806. Input: input,
  807. Config: waiterCfg,
  808. }
  809. return w.Wait()
  810. }
  811. // WaitUntilVpcAvailable uses the Amazon EC2 API operation
  812. // DescribeVpcs to wait for a condition to be met before returning.
  813. // If the condition is not meet within the max attempt window an error will
  814. // be returned.
  815. func (c *EC2) WaitUntilVpcAvailable(input *DescribeVpcsInput) error {
  816. waiterCfg := waiter.Config{
  817. Operation: "DescribeVpcs",
  818. Delay: 15,
  819. MaxAttempts: 40,
  820. Acceptors: []waiter.WaitAcceptor{
  821. {
  822. State: "success",
  823. Matcher: "pathAll",
  824. Argument: "Vpcs[].State",
  825. Expected: "available",
  826. },
  827. },
  828. }
  829. w := waiter.Waiter{
  830. Client: c,
  831. Input: input,
  832. Config: waiterCfg,
  833. }
  834. return w.Wait()
  835. }
  836. // WaitUntilVpcExists uses the Amazon EC2 API operation
  837. // DescribeVpcs to wait for a condition to be met before returning.
  838. // If the condition is not meet within the max attempt window an error will
  839. // be returned.
  840. func (c *EC2) WaitUntilVpcExists(input *DescribeVpcsInput) error {
  841. waiterCfg := waiter.Config{
  842. Operation: "DescribeVpcs",
  843. Delay: 1,
  844. MaxAttempts: 5,
  845. Acceptors: []waiter.WaitAcceptor{
  846. {
  847. State: "success",
  848. Matcher: "status",
  849. Argument: "",
  850. Expected: 200,
  851. },
  852. {
  853. State: "retry",
  854. Matcher: "error",
  855. Argument: "",
  856. Expected: "InvalidVpcID.NotFound",
  857. },
  858. },
  859. }
  860. w := waiter.Waiter{
  861. Client: c,
  862. Input: input,
  863. Config: waiterCfg,
  864. }
  865. return w.Wait()
  866. }
  867. // WaitUntilVpcPeeringConnectionExists uses the Amazon EC2 API operation
  868. // DescribeVpcPeeringConnections to wait for a condition to be met before returning.
  869. // If the condition is not meet within the max attempt window an error will
  870. // be returned.
  871. func (c *EC2) WaitUntilVpcPeeringConnectionExists(input *DescribeVpcPeeringConnectionsInput) error {
  872. waiterCfg := waiter.Config{
  873. Operation: "DescribeVpcPeeringConnections",
  874. Delay: 15,
  875. MaxAttempts: 40,
  876. Acceptors: []waiter.WaitAcceptor{
  877. {
  878. State: "success",
  879. Matcher: "status",
  880. Argument: "",
  881. Expected: 200,
  882. },
  883. {
  884. State: "retry",
  885. Matcher: "error",
  886. Argument: "",
  887. Expected: "InvalidVpcPeeringConnectionID.NotFound",
  888. },
  889. },
  890. }
  891. w := waiter.Waiter{
  892. Client: c,
  893. Input: input,
  894. Config: waiterCfg,
  895. }
  896. return w.Wait()
  897. }
  898. // WaitUntilVpnConnectionAvailable uses the Amazon EC2 API operation
  899. // DescribeVpnConnections to wait for a condition to be met before returning.
  900. // If the condition is not meet within the max attempt window an error will
  901. // be returned.
  902. func (c *EC2) WaitUntilVpnConnectionAvailable(input *DescribeVpnConnectionsInput) error {
  903. waiterCfg := waiter.Config{
  904. Operation: "DescribeVpnConnections",
  905. Delay: 15,
  906. MaxAttempts: 40,
  907. Acceptors: []waiter.WaitAcceptor{
  908. {
  909. State: "success",
  910. Matcher: "pathAll",
  911. Argument: "VpnConnections[].State",
  912. Expected: "available",
  913. },
  914. {
  915. State: "failure",
  916. Matcher: "pathAny",
  917. Argument: "VpnConnections[].State",
  918. Expected: "deleting",
  919. },
  920. {
  921. State: "failure",
  922. Matcher: "pathAny",
  923. Argument: "VpnConnections[].State",
  924. Expected: "deleted",
  925. },
  926. },
  927. }
  928. w := waiter.Waiter{
  929. Client: c,
  930. Input: input,
  931. Config: waiterCfg,
  932. }
  933. return w.Wait()
  934. }
  935. // WaitUntilVpnConnectionDeleted uses the Amazon EC2 API operation
  936. // DescribeVpnConnections to wait for a condition to be met before returning.
  937. // If the condition is not meet within the max attempt window an error will
  938. // be returned.
  939. func (c *EC2) WaitUntilVpnConnectionDeleted(input *DescribeVpnConnectionsInput) error {
  940. waiterCfg := waiter.Config{
  941. Operation: "DescribeVpnConnections",
  942. Delay: 15,
  943. MaxAttempts: 40,
  944. Acceptors: []waiter.WaitAcceptor{
  945. {
  946. State: "success",
  947. Matcher: "pathAll",
  948. Argument: "VpnConnections[].State",
  949. Expected: "deleted",
  950. },
  951. {
  952. State: "failure",
  953. Matcher: "pathAny",
  954. Argument: "VpnConnections[].State",
  955. Expected: "pending",
  956. },
  957. },
  958. }
  959. w := waiter.Waiter{
  960. Client: c,
  961. Input: input,
  962. Config: waiterCfg,
  963. }
  964. return w.Wait()
  965. }