A Terraform module to generate or import SSH key pairs and manage them in AWS.
terraform-aws-key-pair is a Terraform module that automates the generation or import of SSH key pairs and their management within AWS. It solves the problem of manually creating and managing SSH keys for AWS resources by providing a declarative way to handle key lifecycle, including creation, storage in SSM Parameter Store, and registration as an AWS Key Pair.
DevOps engineers, SREs, and cloud infrastructure teams using Terraform to manage AWS infrastructure who need a consistent, automated way to handle SSH keys for EC2 instances or other services.
Developers choose this module because it encapsulates best practices for SSH key management in AWS, reduces manual steps and potential errors, integrates seamlessly with Terraform workflows, and offers secure storage options like SSM Parameter Store.
Terraform Module to Automatically Generate SSH Key Pairs (Public/Private Keys)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Creates new RSA SSH key pairs on-the-fly when configured, eliminating manual steps and reducing human error in key creation.
Optionally stores private keys in AWS Systems Manager Parameter Store, providing encrypted, managed secret storage as highlighted in the README's secure storage options.
Accommodates existing workflows by allowing import of pre-existing SSH public key files, as shown in the input variables for ssh_public_key_file.
Provides key names, filenames, and contents as Terraform outputs, enabling seamless integration with other modules like EC2 instance configurations.
Relies on Cloud Posse's label module for resource naming, which adds external dependency and may require familiarity with their conventions, as seen in the modules section.
Defaults to RSA algorithm with ssh_key_algorithm input, and the README doesn't mention support for modern alternatives like Ed25519, potentially limiting cryptographic choices.
Enabling SSM parameter storage incurs additional AWS costs and requires careful IAM permission setup, which might not be justified for small-scale or cost-sensitive projects.