waiters.go 791 B

12345678910111213141516171819202122232425262728293031323334
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package cloudwatch
  3. import (
  4. "github.com/aws/aws-sdk-go/private/waiter"
  5. )
  6. // WaitUntilAlarmExists uses the CloudWatch API operation
  7. // DescribeAlarms 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 *CloudWatch) WaitUntilAlarmExists(input *DescribeAlarmsInput) error {
  11. waiterCfg := waiter.Config{
  12. Operation: "DescribeAlarms",
  13. Delay: 5,
  14. MaxAttempts: 40,
  15. Acceptors: []waiter.WaitAcceptor{
  16. {
  17. State: "success",
  18. Matcher: "path",
  19. Argument: "length(MetricAlarms[]) > `0`",
  20. Expected: true,
  21. },
  22. },
  23. }
  24. w := waiter.Waiter{
  25. Client: c,
  26. Input: input,
  27. Config: waiterCfg,
  28. }
  29. return w.Wait()
  30. }