diff --git a/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_terraform.go b/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_terraform.go index 2d154483c47f1..c65e2f1266e07 100644 --- a/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_terraform.go +++ b/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_terraform.go @@ -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 { diff --git a/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_terraform_test.go b/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_terraform_test.go index 4731dbcd1d342..6dd71ec4f0480 100644 --- a/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_terraform_test.go +++ b/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_terraform_test.go @@ -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), @@ -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}"]