From 99f9b93b575e33273241ff08e58c589ba07819ba Mon Sep 17 00:00:00 2001 From: Clint Shryock Date: Tue, 7 Jul 2015 15:12:41 -0600 Subject: [PATCH] provider/aws: Error when unable to find a Root Block Device name Fixes #2633 --- builtin/providers/aws/resource_aws_instance.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/providers/aws/resource_aws_instance.go b/builtin/providers/aws/resource_aws_instance.go index 6d6657c157..d6ec35af1d 100644 --- a/builtin/providers/aws/resource_aws_instance.go +++ b/builtin/providers/aws/resource_aws_instance.go @@ -778,6 +778,10 @@ func fetchRootDeviceName(ami string, conn *ec2.EC2) (*string, error) { rootDeviceName = image.BlockDeviceMappings[0].DeviceName } + if rootDeviceName == nil { + return nil, fmt.Errorf("[WARN] Error finding Root Device Name for AMI (%s)", ami) + } + return rootDeviceName, nil }