-
Notifications
You must be signed in to change notification settings - Fork 17
/
awsec2_LaunchTemplateSpotOptions.go
52 lines (49 loc) · 2.32 KB
/
awsec2_LaunchTemplateSpotOptions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package awsec2
import (
"github.com/aws/aws-cdk-go/awscdk/v2"
)
// Interface for the Spot market instance options provided in a LaunchTemplate.
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import cdk "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
//
// var expiration expiration
//
// launchTemplateSpotOptions := &launchTemplateSpotOptions{
// blockDuration: cdk.duration.minutes(jsii.Number(30)),
// interruptionBehavior: awscdk.Aws_ec2.spotInstanceInterruption_STOP,
// maxPrice: jsii.Number(123),
// requestType: awscdk.*Aws_ec2.spotRequestType_ONE_TIME,
// validUntil: expiration,
// }
//
type LaunchTemplateSpotOptions struct {
// Spot Instances with a defined duration (also known as Spot blocks) are designed not to be interrupted and will run continuously for the duration you select.
//
// You can use a duration of 1, 2, 3, 4, 5, or 6 hours.
// See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html#fixed-duration-spot-instances
//
BlockDuration awscdk.Duration `field:"optional" json:"blockDuration" yaml:"blockDuration"`
// The behavior when a Spot Instance is interrupted.
InterruptionBehavior SpotInstanceInterruption `field:"optional" json:"interruptionBehavior" yaml:"interruptionBehavior"`
// Maximum hourly price you're willing to pay for each Spot instance.
//
// The value is given
// in dollars. ex: 0.01 for 1 cent per hour, or 0.001 for one-tenth of a cent per hour.
MaxPrice *float64 `field:"optional" json:"maxPrice" yaml:"maxPrice"`
// The Spot Instance request type.
//
// If you are using Spot Instances with an Auto Scaling group, use one-time requests, as the
// Amazon EC2 Auto Scaling service handles requesting new Spot Instances whenever the group is
// below its desired capacity.
RequestType SpotRequestType `field:"optional" json:"requestType" yaml:"requestType"`
// The end date of the request.
//
// For a one-time request, the request remains active until all instances
// launch, the request is canceled, or this date is reached. If the request is persistent, it remains
// active until it is canceled or this date and time is reached.
ValidUntil awscdk.Expiration `field:"optional" json:"validUntil" yaml:"validUntil"`
}