From e4dba8609805c890cd6035cf05cdd98634ca34c1 Mon Sep 17 00:00:00 2001 From: clint shryock Date: Wed, 9 Dec 2015 16:39:03 -0600 Subject: [PATCH] provider/aws: Fix missing AMI issue with Launch Configurations --- builtin/providers/aws/resource_aws_launch_configuration.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builtin/providers/aws/resource_aws_launch_configuration.go b/builtin/providers/aws/resource_aws_launch_configuration.go index 1cc010634e..a257a10b44 100644 --- a/builtin/providers/aws/resource_aws_launch_configuration.go +++ b/builtin/providers/aws/resource_aws_launch_configuration.go @@ -386,6 +386,11 @@ func resourceAwsLaunchConfigurationCreate(d *schema.ResourceData, meta interface } if dn, err := fetchRootDeviceName(d.Get("image_id").(string), ec2conn); err == nil { + if dn == nil { + return fmt.Errorf( + "Expected to find a Root Device name for AMI (%s), but got none", + d.Get("image_id").(string)) + } blockDevices = append(blockDevices, &autoscaling.BlockDeviceMapping{ DeviceName: dn, Ebs: ebs,