如何等待CloudFormation堆栈更新Ruby?

时间:2016-06-15 23:18:06

标签: ruby amazon-web-services amazon-cloudformation

鉴于您正在使用AWS Ruby SDK(2.0),如何等待CloudFormation堆栈更新?

1 个答案:

答案 0 :(得分:1)

服务员每隔delaymax_attempts将更新的Stack个实例传递到给定的块中。

# @client is your client
stack = Aws::CloudFormation::Stack.new(name, :client => @client)
stack(stage).wait_until({delay: 15, max_attempts: 20}) do |i|
  i.stack_status == 'STACK_UPDATE_COMPLETE' 
end