waiters.go 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package cloudformation
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. func (c *CloudFormation) WaitUntilStackCreateComplete(input *DescribeStacksInput) error {
  7. waiterCfg := waiter.Config{
  8. Operation: "DescribeStacks",
  9. Delay: 30,
  10. MaxAttempts: 120,
  11. Acceptors: []waiter.WaitAcceptor{
  12. {
  13. State: "success",
  14. Matcher: "pathAll",
  15. Argument: "Stacks[].StackStatus",
  16. Expected: "CREATE_COMPLETE",
  17. },
  18. {
  19. State: "failure",
  20. Matcher: "pathAny",
  21. Argument: "Stacks[].StackStatus",
  22. Expected: "CREATE_FAILED",
  23. },
  24. {
  25. State: "failure",
  26. Matcher: "pathAny",
  27. Argument: "Stacks[].StackStatus",
  28. Expected: "DELETE_COMPLETE",
  29. },
  30. {
  31. State: "failure",
  32. Matcher: "pathAny",
  33. Argument: "Stacks[].StackStatus",
  34. Expected: "DELETE_IN_PROGRESS",
  35. },
  36. {
  37. State: "failure",
  38. Matcher: "pathAny",
  39. Argument: "Stacks[].StackStatus",
  40. Expected: "DELETE_FAILED",
  41. },
  42. {
  43. State: "failure",
  44. Matcher: "pathAny",
  45. Argument: "Stacks[].StackStatus",
  46. Expected: "ROLLBACK_COMPLETE",
  47. },
  48. {
  49. State: "failure",
  50. Matcher: "pathAny",
  51. Argument: "Stacks[].StackStatus",
  52. Expected: "ROLLBACK_FAILED",
  53. },
  54. {
  55. State: "failure",
  56. Matcher: "pathAny",
  57. Argument: "Stacks[].StackStatus",
  58. Expected: "ROLLBACK_IN_PROGRESS",
  59. },
  60. {
  61. State: "failure",
  62. Matcher: "error",
  63. Argument: "",
  64. Expected: "ValidationError",
  65. },
  66. },
  67. }
  68. w := waiter.Waiter{
  69. Client: c,
  70. Input: input,
  71. Config: waiterCfg,
  72. }
  73. return w.Wait()
  74. }
  75. func (c *CloudFormation) WaitUntilStackDeleteComplete(input *DescribeStacksInput) error {
  76. waiterCfg := waiter.Config{
  77. Operation: "DescribeStacks",
  78. Delay: 30,
  79. MaxAttempts: 120,
  80. Acceptors: []waiter.WaitAcceptor{
  81. {
  82. State: "success",
  83. Matcher: "pathAll",
  84. Argument: "Stacks[].StackStatus",
  85. Expected: "DELETE_COMPLETE",
  86. },
  87. {
  88. State: "success",
  89. Matcher: "error",
  90. Argument: "",
  91. Expected: "ValidationError",
  92. },
  93. {
  94. State: "failure",
  95. Matcher: "pathAny",
  96. Argument: "Stacks[].StackStatus",
  97. Expected: "DELETE_FAILED",
  98. },
  99. {
  100. State: "failure",
  101. Matcher: "pathAny",
  102. Argument: "Stacks[].StackStatus",
  103. Expected: "CREATE_COMPLETE",
  104. },
  105. {
  106. State: "failure",
  107. Matcher: "pathAny",
  108. Argument: "Stacks[].StackStatus",
  109. Expected: "CREATE_FAILED",
  110. },
  111. {
  112. State: "failure",
  113. Matcher: "pathAny",
  114. Argument: "Stacks[].StackStatus",
  115. Expected: "CREATE_IN_PROGRESS",
  116. },
  117. {
  118. State: "failure",
  119. Matcher: "pathAny",
  120. Argument: "Stacks[].StackStatus",
  121. Expected: "ROLLBACK_COMPLETE",
  122. },
  123. {
  124. State: "failure",
  125. Matcher: "pathAny",
  126. Argument: "Stacks[].StackStatus",
  127. Expected: "ROLLBACK_FAILED",
  128. },
  129. {
  130. State: "failure",
  131. Matcher: "pathAny",
  132. Argument: "Stacks[].StackStatus",
  133. Expected: "ROLLBACK_IN_PROGRESS",
  134. },
  135. {
  136. State: "failure",
  137. Matcher: "pathAny",
  138. Argument: "Stacks[].StackStatus",
  139. Expected: "UPDATE_COMPLETE",
  140. },
  141. {
  142. State: "failure",
  143. Matcher: "pathAny",
  144. Argument: "Stacks[].StackStatus",
  145. Expected: "UPDATE_COMPLETE_CLEANUP_IN_PROGRESS",
  146. },
  147. {
  148. State: "failure",
  149. Matcher: "pathAny",
  150. Argument: "Stacks[].StackStatus",
  151. Expected: "UPDATE_IN_PROGRESS",
  152. },
  153. {
  154. State: "failure",
  155. Matcher: "pathAny",
  156. Argument: "Stacks[].StackStatus",
  157. Expected: "UPDATE_ROLLBACK_COMPLETE",
  158. },
  159. {
  160. State: "failure",
  161. Matcher: "pathAny",
  162. Argument: "Stacks[].StackStatus",
  163. Expected: "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS",
  164. },
  165. {
  166. State: "failure",
  167. Matcher: "pathAny",
  168. Argument: "Stacks[].StackStatus",
  169. Expected: "UPDATE_ROLLBACK_FAILED",
  170. },
  171. {
  172. State: "failure",
  173. Matcher: "pathAny",
  174. Argument: "Stacks[].StackStatus",
  175. Expected: "UPDATE_ROLLBACK_IN_PROGRESS",
  176. },
  177. },
  178. }
  179. w := waiter.Waiter{
  180. Client: c,
  181. Input: input,
  182. Config: waiterCfg,
  183. }
  184. return w.Wait()
  185. }
  186. func (c *CloudFormation) WaitUntilStackExists(input *DescribeStacksInput) error {
  187. waiterCfg := waiter.Config{
  188. Operation: "DescribeStacks",
  189. Delay: 5,
  190. MaxAttempts: 20,
  191. Acceptors: []waiter.WaitAcceptor{
  192. {
  193. State: "success",
  194. Matcher: "status",
  195. Argument: "",
  196. Expected: 200,
  197. },
  198. {
  199. State: "retry",
  200. Matcher: "error",
  201. Argument: "",
  202. Expected: "ValidationError",
  203. },
  204. },
  205. }
  206. w := waiter.Waiter{
  207. Client: c,
  208. Input: input,
  209. Config: waiterCfg,
  210. }
  211. return w.Wait()
  212. }
  213. func (c *CloudFormation) WaitUntilStackUpdateComplete(input *DescribeStacksInput) error {
  214. waiterCfg := waiter.Config{
  215. Operation: "DescribeStacks",
  216. Delay: 30,
  217. MaxAttempts: 120,
  218. Acceptors: []waiter.WaitAcceptor{
  219. {
  220. State: "success",
  221. Matcher: "pathAll",
  222. Argument: "Stacks[].StackStatus",
  223. Expected: "UPDATE_COMPLETE",
  224. },
  225. {
  226. State: "failure",
  227. Matcher: "pathAny",
  228. Argument: "Stacks[].StackStatus",
  229. Expected: "UPDATE_FAILED",
  230. },
  231. {
  232. State: "failure",
  233. Matcher: "pathAny",
  234. Argument: "Stacks[].StackStatus",
  235. Expected: "UPDATE_ROLLBACK_COMPLETE",
  236. },
  237. {
  238. State: "failure",
  239. Matcher: "pathAny",
  240. Argument: "Stacks[].StackStatus",
  241. Expected: "UPDATE_ROLLBACK_FAILED",
  242. },
  243. {
  244. State: "failure",
  245. Matcher: "pathAny",
  246. Argument: "Stacks[].StackStatus",
  247. Expected: "UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS",
  248. },
  249. {
  250. State: "failure",
  251. Matcher: "pathAny",
  252. Argument: "Stacks[].StackStatus",
  253. Expected: "UPDATE_ROLLBACK_IN_PROGRESS",
  254. },
  255. {
  256. State: "failure",
  257. Matcher: "error",
  258. Argument: "",
  259. Expected: "ValidationError",
  260. },
  261. },
  262. }
  263. w := waiter.Waiter{
  264. Client: c,
  265. Input: input,
  266. Config: waiterCfg,
  267. }
  268. return w.Wait()
  269. }