waiters.go 6.7 KB

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