简体   繁体   中英

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

Is it possible to have an AWS::EC2::SpotFleet resource in my stack that's set to be a one-time request instead of a maintain -ed fleet (see the EC2 docs for the difference)?

The EC2 API documentation offers a Type property, but the CloudFormation template reference doesn't offer it, failing validation and rolling back during stack creation.

Any help would be appreciated - thanks!

Update : Yes, as of Aug 18 2017 , it is now possible to specify the SpotFleetRequestConfigData.Type parameter (either request or maintain ) in the AWS::EC2::SpotFleet CloudFormation resource implementation.


(original answer from Dec 31 2016 below)

No, it's currently not possible to specify the SpotFleetRequestConfig.Type request parameter in the RequestSpotFleet API call through the SpotFleetRequestConfigData parameter in the AWS::EC2::SpotFleet CloudFormation resource implementation.

The AWS::EC2::SpotFleet CloudFormation resource was originally added October 1 2015 , and the Spot Fleet Type parameter was added to the API sometime around June 2 2016 . Presumably, the work necessary to update the resource implementation to match the new EC2 API has not been prioritized since then. (Many of the official CloudFormation resources lag behind their AWS API counterparts in this manner, unfortunately).

As a workaround, you could implement your own Lambda-backed Custom Resource that uses the AWS SDK for JavaScript to call requestSpotFleet directly. The AWS SDKs tend to track additions/evolutions to the AWS APIs much more quickly than the corresponding CloudFormation resources.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM