Skip to content

Commit

Permalink
provider/aws: Fix missing AMI issue with Launch Configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
catsby committed Dec 9, 2015
1 parent 981add7 commit e4dba86
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions builtin/providers/aws/resource_aws_launch_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e4dba86

Please sign in to comment.