Skip to content

Commit

Permalink
1594_ec2_instance_key_name_is_not_an_error
Browse files Browse the repository at this point in the history
  • Loading branch information
nesies authored and nesies committed Jun 6, 2023
1 parent ee68be3 commit 7d69003
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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

0 comments on commit 7d69003

Please sign in to comment.