AC.

How to Create SSH keys with Terraform

Original Article: How to Create SSH keys with Terraform?

Summary

This article guides you through generating SSH key pairs using Terraform, provisioning a virtual machine (VM) with the generated keys, and leveraging GitHub Actions for secure server access. It covers key generation, VM configuration, and setting up secrets in GitHub, ensuring convenient infrastructure management.

Key topics include:

  • Generating SSH key pairs with Terraform.
  • Provisioning a VM with the generated SSH keys (Digital Ocean example).
  • Using GitHub Actions to securely access the server.
  • Automating the creation of GitHub environment secrets with Terraform.

This approach enables you to manage your infrastructure as code and avoid manually handling SSH keys, assuming you trust your Terraform Backend Storage (an issue that might finally be solved in future terraform versions)

About Me Author

My name is

Alexandre Couedelo

Tech Writer && DevOps ~ Build engineering blogs ~ DevOps, Kubernetes, Security, SRE Read More