我的 AWS CloudFormation 堆栈的 Spot 队列资源可以是 "request" 而不是 "maintain"-ed 吗?

Can my AWS CloudFormation stack's Spot Fleet resource be a "request" instead of "maintain"-ed?

是否可以在我的堆栈中有一个 AWS::EC2::SpotFleet 资源设置为一次性 request 而不是 一个 maintain-ed 舰队(请参阅 the EC2 docs 了解差异)?

EC2 API documentation offers a Type property, but the CloudFormation template reference 不提供它,验证失败并在堆栈创建期间回滚。

如有任何帮助,我们将不胜感激 - 谢谢!

更新:是的,截至 2017 年 8 月 18 日,现在可以指定 SpotFleetRequestConfigData.Type parameter (either request or maintain) in the AWS::EC2::SpotFleet CloudFormation 资源实施.


(下面是 2016 年 12 月 31 日的原始答案)

不,目前无法指定 SpotFleetRequestConfig.Type request parameter in the RequestSpotFleet API call through the SpotFleetRequestConfigData parameter in the AWS::EC2::SpotFleet CloudFormation 资源实现。

最初添加了 AWS::EC2::SpotFleet CloudFormation 资源 October 1 2015, and the Spot Fleet Type parameter was added to the API sometime around June 2 2016。据推测,更新资源实现以匹配新 EC2 API 所需的工作从那时起就没有被优先考虑。 (不幸的是,许多官方 CloudFormation 资源以这种方式落后于 AWS API 对应资源)。

作为解决方法,您可以直接实施自己的 Lambda 支持 Custom Resource that uses the AWS SDK for JavaScript to call requestSpotFleet。 AWS SDK 倾向于 additions/evolutions 跟踪 AWS APIs much 比相应的 CloudFormation 资源更快。