Merge pull request #4242 from hashicorp/b-aws-lc-guard

provider/aws: Fix missing AMI issue with Launch Configurations
This commit is contained in:
Clint 2015-12-10 08:55:49 -06:00
commit eb3840c574
1 changed files with 5 additions and 0 deletions

View File

@ -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,