Add printing of launch template id

This commit is contained in:
Narthana Epa 2021-01-09 23:59:31 +11:00
parent f7e68f1d71
commit f7588a3737
No known key found for this signature in database
GPG Key ID: 7ABC460881544B69
1 changed files with 4 additions and 1 deletions

View File

@ -273,7 +273,7 @@ func (s *StepRunSpotInstance) Run(ctx context.Context, state multistep.StateBag)
}
// Tell EC2 to create the template
_, err = ec2conn.CreateLaunchTemplate(launchTemplate)
createLaunchTemplateOutput, err := ec2conn.CreateLaunchTemplate(launchTemplate)
if err != nil {
err := fmt.Errorf("Error creating launch template for spot instance: %s", err)
state.Put("error", err)
@ -281,6 +281,9 @@ func (s *StepRunSpotInstance) Run(ctx context.Context, state multistep.StateBag)
return multistep.ActionHalt
}
launchTemplateId := createLaunchTemplateOutput.LaunchTemplate.LaunchTemplateId
ui.Message(fmt.Sprintf("Created Spot Fleet launch template: %s", *launchTemplateId))
// Add overrides for each user-provided instance type
var overrides []*ec2.FleetLaunchTemplateOverridesRequest
for _, instanceType := range s.SpotInstanceTypes {