Git Product home page Git Product logo

terraform-aws-dynamic-keys's Introduction

AWS Dynamic Keypair

This Terraform module dynamically generates an SSH key pair, imports it into AWS, and provides the keypair via outputs.

This can be used to create AWS resources with a keypair that doesn't have to exist prior to the Terraform run. This is great for demos! Warning that the private key information will be in the Terraform state, so this isn't well suited currently for production environments.

What This Module Does

Features:

  • Creates a public/private keypair.

  • Writes the keypair into files (optional).

  • Imports the keypair into AWS.

  • Provides the OpenSSH-formatted public key and a PEM-encoded private key as output values that can be used directly with connection blocks.

Usage

Run terraform apply against the example configuration below:

provider "aws" {
  version = "~> 1.0.0"
  region  = "us-west-2"
}

module "keypair" {
  source = "mitchellh/dynamic-keys/aws"
  path   = "${path.root}/keys"
}

output "private_key_pem" {
  value = "${module.keypair.private_key_pem}"
}

The SSH keys created are also in the ./keys subdirectory relative to the root Terraform configuration if you need those for any other reason. These keys will be automatically deleted and removed when your configuration is destroyed (via terraform destroy).

Terraform version

Terraform version 0.11.0 or newer is required for this version to work.

terraform-aws-dynamic-keys's People

Contributors

mitchellh avatar taylorsmithgg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.