mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-10 17:20:26 -04:00
Merge pull request #2845 from abridgett/feature/spot_price_zero
spot_price of "0" to mean on demand
This commit is contained in:
commit
4e1e9b788a
4 changed files with 6 additions and 4 deletions
|
|
@ -136,7 +136,7 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
|
|||
|
||||
var instanceId string
|
||||
|
||||
if spotPrice == "" {
|
||||
if spotPrice == "" || spotPrice == "0" {
|
||||
runOpts := &ec2.RunInstancesInput{
|
||||
KeyName: &keyName,
|
||||
ImageId: &s.SourceAMI,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ func (s *stepStopInstance) Run(state multistep.StateBag) multistep.StepAction {
|
|||
ui := state.Get("ui").(packer.Ui)
|
||||
|
||||
// Skip when it is a spot instance
|
||||
if s.SpotPrice != "" {
|
||||
if s.SpotPrice != "" && s.SpotPrice != "0" {
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,8 @@ builder.
|
|||
when the current spot price is less than the maximum price you specify. Spot
|
||||
price will be updated based on available spot instance capacity and current
|
||||
spot instance requests. It may save you some costs. You can set this to
|
||||
"auto" for Packer to automatically discover the best spot price.
|
||||
"auto" for Packer to automatically discover the best spot price or to "0"
|
||||
to use an on demand instance (default).
|
||||
|
||||
- `spot_price_auto_product` (string) - Required if `spot_price` is set
|
||||
to "auto". This tells Packer what sort of AMI you're launching to find the
|
||||
|
|
|
|||
|
|
@ -195,7 +195,8 @@ builder.
|
|||
maximum price that you specify exceeds the current spot price. Spot price
|
||||
will be updated based on available spot instance capacity and current spot
|
||||
Instance requests. It may save you some costs. You can set this to "auto"
|
||||
for Packer to automatically discover the best spot price.
|
||||
for Packer to automatically discover the best spot price or to "0" to use
|
||||
an on demand instance (default).
|
||||
|
||||
- `spot_price_auto_product` (string) - Required if `spot_price` is set
|
||||
to "auto". This tells Packer what sort of AMI you're launching to find the
|
||||
|
|
|
|||
Loading…
Reference in a new issue