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

Can't use PrivateKeyFile on AWS without providing a KeyPairName #2281

Closed
ColinHebert opened this issue Jun 19, 2015 · 3 comments
Closed

Can't use PrivateKeyFile on AWS without providing a KeyPairName #2281

ColinHebert opened this issue Jun 19, 2015 · 3 comments

Comments

@ColinHebert
Copy link
Contributor

It seems that the recent changes in the way the KeyPair is managed in Packer for AWS broke the use of a private key file that doesn't rely on a key pair existing in AWS

In particular we can see that now, a key pair name is always set (whether it's needed or not)
https://github.com/mitchellh/packer/blob/master/builder/amazon/common/run_config.go#L42

Followed by assumptions about the key pair not being set (which is now impossible) has an impact on the configuration:
https://github.com/mitchellh/packer/blob/master/builder/amazon/common/step_key_pair.go#L25

Now, building an image with packer providing only the private key file results in messages such as

1434669095,amazon-ebs,error,Error launching source instance: InvalidKeyPair.NotFound: The key pair 'packer 55834f31-2f68-7b3f-c518-86fb895e55eb' does not exist\n status code: 400%!(PACKER_COMMA) request id: []

The key doesn't exist obviously (because it isn't needed).

@ColinHebert
Copy link
Contributor Author

CC @nyetsche @yosssi who worked on the new settings.

Relates to #2256, #1697, #1635, #1837

@mitchellh
Copy link
Contributor

Thanks for the report. I think we had a couple PRs that we merged that caused this issue and we'll fix it ASAP.

@mitchellh
Copy link
Contributor

This should be all fixed up. There was a weird interaction. Verified with acceptance tests. Thanks!

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

No branches or pull requests

2 participants