diff --git a/builder/amazon/common/step_run_spot_instance.go b/builder/amazon/common/step_run_spot_instance.go index 0f9e65aaf..acf6b0478 100644 --- a/builder/amazon/common/step_run_spot_instance.go +++ b/builder/amazon/common/step_run_spot_instance.go @@ -324,6 +324,11 @@ func (s *StepRunSpotInstance) Run(ctx context.Context, state multistep.StateBag) describeOutput, err = ec2conn.DescribeInstances(&ec2.DescribeInstancesInput{ InstanceIds: []*string{aws.String(instanceId)}, }) + if len(describeOutput.Reservations) > 0 && len(describeOutput.Reservations[0].Instances) > 0 { + if len(s.LaunchMappings.BuildEC2BlockDeviceMappings()) > 0 && len(describeOutput.Reservations[0].Instances[0].BlockDeviceMappings) == 0 { + return fmt.Errorf("Instance has no block devices") + } + } return err }) if err != nil || len(describeOutput.Reservations) == 0 || len(describeOutput.Reservations[0].Instances) == 0 {