Skip to content
Merged
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
3 changes: 3 additions & 0 deletions changelogs/fragments/doc_update_for_keypair_nolog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- Update the document to use no_log and register when creating a new keypair.
5 changes: 5 additions & 0 deletions plugins/modules/ec2_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
version_added: 3.1.0
notes:
- Support for I(tags) and I(purge_tags) was added in release 2.1.0.
- For security reasons, this module should be used with B(no_log=true) and (register) functionalities
when creating new key pair without providing key_material.
extends_documentation_fragment:
- amazon.aws.common.modules
- amazon.aws.region.modules
Expand All @@ -64,8 +66,11 @@
# Note: These examples do not set authentication details, see the AWS Guide for details.

- name: create a new EC2 key pair, returns generated private key
# use no_log to avoid private key being displayed into output
amazon.aws.ec2_key:
name: my_keypair
no_log: true
register: aws_ec2_key_pair

- name: create key pair using provided key_material
amazon.aws.ec2_key:
Expand Down