Skip to content

Commit

Permalink
Merge pull request #4242 from hashicorp/b-aws-lc-guard
Browse files Browse the repository at this point in the history
provider/aws: Fix missing AMI issue with Launch Configurations
  • Loading branch information
catsby committed Dec 10, 2015
2 parents b23e6ed + e4dba86 commit eb3840c
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 eb3840c

Please sign in to comment.