Skip to content

Commit

Permalink
Allow creation of everlasting spot fleet requests
Browse files Browse the repository at this point in the history
According to the AWS API doc, if `valid until` is _not_ set, then the spot fleet request "remains until you cancel it". By having a 24 hr default, then this behaviour cannot be achieved using this terraform provider - so the default it removed.

Some conversation about the default: 5bafd4b#r34628957
The relevant AWS doc: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetRequestConfigData.html
  • Loading branch information
jkburges committed Aug 11, 2019
1 parent cc3dba0 commit a005a97
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions aws/resource_aws_spot_fleet_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,9 +686,6 @@ func resourceAwsSpotFleetRequestCreate(d *schema.ResourceData, meta interface{})
return err
}
spotFleetConfig.ValidUntil = aws.Time(valid_until)
} else {
valid_until := time.Now().Add(24 * time.Hour)
spotFleetConfig.ValidUntil = aws.Time(valid_until)
}

if v, ok := d.GetOk("load_balancers"); ok && v.(*schema.Set).Len() > 0 {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/spot_fleet_request.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ across different markets and instance types.
`terminate`.
* `fleet_type` - (Optional) The type of fleet request. Indicates whether the Spot Fleet only requests the target
capacity or also attempts to maintain it. Default is `maintain`.
* `valid_until` - (Optional) The end date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot instance requests are placed or enabled to fulfill the request. Defaults to 24 hours.
* `valid_until` - (Optional) The end date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). At this point, no new Spot instance requests are placed or enabled to fulfill the request.
* `valid_from` - (Optional) The start date and time of the request, in UTC [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.8) format(for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
* `load_balancers` (Optional) A list of elastic load balancer names to add to the Spot fleet.
* `target_group_arns` (Optional) A list of `aws_alb_target_group` ARNs, for use with Application Load Balancing.
Expand Down

0 comments on commit a005a97

Please sign in to comment.