Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/aws: Fix missing AMI issue with Launch Configurations #4242

Merged
merged 1 commit into from
Dec 10, 2015

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Dec 9, 2015

If a launch configuration references an AMI that does not exist, it will fail to find the DeviceName for the AMI when it's building up it's Block Device Mappings.

Unlike other invocations of the fetchRootDeviceName method, Launch Configurations was not checking for a nil device name.

The resulting Block Mappings end up something like this:

BlockDeviceMappings: [{
       Ebs: {
         DeleteOnTermination: true,
         VolumeSize: 1024,
         VolumeType: "gp2"
       }
     }],

(no device name, required for EBS)

And then get an error on apply similar to this:

* aws_launch_configuration.lc: Error creating launch configuration: InvalidParameter: 1 validation errors:
- missing required parameter: BlockDeviceMappings[0].DeviceName

This PR errors if a nil device name is returned.

@stack72
Copy link
Contributor

stack72 commented Dec 9, 2015

how did you find this error @catsby? it wasn't even reported 😛

@catsby
Copy link
Contributor Author

catsby commented Dec 9, 2015

It's edge-case – the AMI needs to be found in fetchRootDeviceName but be in the process of deregistering. Unlikely to happen often, but still, we should account for that nil

@jen20
Copy link
Contributor

jen20 commented Dec 9, 2015

LGTM - nasty edge case there

catsby added a commit that referenced this pull request Dec 10, 2015
provider/aws: Fix missing AMI issue with Launch Configurations
@catsby catsby merged commit eb3840c into master Dec 10, 2015
@catsby catsby deleted the b-aws-lc-guard branch December 10, 2015 14:55
@ghost
Copy link

ghost commented Apr 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants