Amazon web services 创建具有恒定超时的CloudCondition

Amazon web services 创建具有恒定超时的CloudCondition,amazon-web-services,amazon-cloudformation,Amazon Web Services,Amazon Cloudformation,我在我的cloudFormation模板中使用了两个自定义资源。基本上,这些自定义资源是具有自定义代码的lambda函数。我想在连续3分钟后开始创建第二个lambda 我想用cloudFormation的WaitCondition和timeout属性来解决这个问题。但是它需要一个WaitHandle,它必须在超时之前接收成功信号。一旦接收到信号,WaitCondition将变为Create Complete.但在我的情况下,我无法使用自定义函数将信号发送到等待句柄。在完成第一个自定义资源后,我需

我在我的cloudFormation模板中使用了两个自定义资源。基本上,这些自定义资源是具有自定义代码的lambda函数。我想在连续3分钟后开始创建第二个lambda

我想用cloudFormation的WaitConditiontimeout属性来解决这个问题。但是它需要一个WaitHandle,它必须在超时之前接收成功信号。一旦接收到信号,WaitCondition将变为Create Complete.但在我的情况下,我无法使用自定义函数将信号发送到等待句柄。在完成第一个自定义资源后,我需要有一个固定的3分钟等待时间。然后,在创建完成后开始创建第二个自定义资源。以下是我的代码:

"SecondCustomResource": {
  "Type": "Custom::SecondCustomResource",
  "DependsOn" : "WaitCondition",
  "Properties": {
    "ServiceToken": { "Fn::GetAtt" : ["SecondCustomResourceFunction", "Arn"] }
  }
},


"SecondCustomResourceFunction": {
  "Type": "AWS::Lambda::Function",
  "Properties": {
    "Code": {
        "S3Bucket": { "Ref": "S3Bucket" },
        "S3Key": { "Ref": "S3Key" }
    },
    "Handler": { "Fn::Join" : [ "", [{ "Ref": "ModuleName" },".handler"] ] },
    "Runtime": "nodejs4.3",
    "Timeout": "30"
  }
},


"WaitCondition": {
  "Type" : "AWS::CloudFormation::WaitCondition",
  "DependsOn" : "FirstCustomResource",
  "Properties": {
    "Timeout": "180"
  }
},


"FirstCustomResource": {
  "Type": "Custom::FirstCustomResource",
  "Properties": {
    "ServiceToken": { "Fn::GetAtt" : ["FirstCustomResourceFunction", "Arn"] }
  }
},


"FirstCustomResourceFunction": {
  "Type": "AWS::Lambda::Function",
  "Properties": {
    "Code": {
        "S3Bucket": { "Ref": "S3Bucket" },
        "S3Key": { "Ref": "S3Key" }
    },
    "Handler": { "Fn::Join" : [ "", [{ "Ref": "ModuleName" },".handler"] ] },
    "Runtime": "nodejs4.3",
    "Timeout": "30"
  }
}
这似乎不起作用。任何黑客或工作有一个恒定的等待条件


我只想在第一个和第二个自定义资源之间有一个恒定的3分钟等待时间。这可能吗?堆栈中是否有一个实例可以提供“睡眠”,然后向句柄发送信号?没有。我正在自定义函数中部署kubernetes群集。从谷歌云发送成功信号将是困难的。有趣!!我是这么想的,但是当我在Lambda中等待集群将状态更改为Running时,这将是一个昂贵的过程。我理解你对恒定3分钟的担忧,我想我必须想出其他解决方案。Lambda限制现在是900秒(15分钟)