Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick of #6988 onto release-1.12 #7012

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ type terraformLaunchTemplateMarketOptions struct {
// MarketType is the option type
MarketType *string `json:"market_type,omitempty"`
// SpotOptions are the set of options
SpotOptions []*terraformLaunchTemplateMarketOptionsSpotOptions `json:"options,omitempty"`
SpotOptions []*terraformLaunchTemplateMarketOptionsSpotOptions `json:"spot_options,omitempty"`
}

type terraformLaunchTemplateBlockDeviceEBS struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func TestLaunchTemplateTerraformRender(t *testing.T) {
ID: fi.String("test-11"),
InstanceMonitoring: fi.Bool(true),
InstanceType: fi.String("t2.medium"),
SpotPrice: "0.1",
RootVolumeOptimization: fi.Bool(true),
RootVolumeIops: fi.Int64(100),
RootVolumeSize: fi.Int64(64),
Expand Down Expand Up @@ -67,6 +68,14 @@ resource "aws_launch_template" "test" {
instance_type = "t2.medium"
key_name = "${aws_key_pair.newkey.id}"

instance_market_options = {
market_type = "spot"

spot_options = {
max_price = "0.1"
}
}

network_interfaces = {
associate_public_ip_address = true
security_groups = ["${aws_security_group.nodes-1.id}", "${aws_security_group.nodes-2.id}"]
Expand Down