waiters.go 18 KB

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