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

1594_ec2_instance_key_name_is_not_an_error #1595

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- if key_name is empty, assume it is absent
2 changes: 1 addition & 1 deletion plugins/modules/ec2_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ def build_top_level_options(params):
msg="You must include an image_id or image.id parameter to create an instance, or use a launch_template."
)

if params.get("key_name") is not None:
if params.get("key_name") not in (None, ""):
spec["KeyName"] = params.get("key_name")

spec.update(build_userdata(params))
Expand Down
Loading