diff --git a/README.md b/README.md index dc22428..ea2c2db 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Terraform module which creates EC2 key pair on AWS. The private key will be stor ```hcl module "key_pair" { - source = "squareops/terraform-aws-keypair" + source = "squareops/keypair/aws" environment = production key_name = example-key @@ -23,6 +23,18 @@ module "key_pair" { Refer [examples](https://github.com/squareops/terraform-aws-keypair/tree/main/examples) for all examples. +## Retrieve Private Key + +To Retrieve the Private key from SSM: +```bash +aws ssm get-parameter --region=us-east-1 --name "production-example-key" --with-decryption --output text --query Parameter.Value +``` + +Additionally, to save the private to a file: +```bash +aws ssm get-parameter --region=us-east-1 --name "production-example-key" --with-decryption --output text --query Parameter.Value > private-key.pem +``` + ## IAM Permission The required IAM permissions to create resources from this module can be found [here](https://github.com/squareops/terraform-aws-keypair/blob/main/IAM.md) diff --git a/examples/complete/README.md b/examples/complete/README.md index 923d62f..57d79b7 100644 --- a/examples/complete/README.md +++ b/examples/complete/README.md @@ -14,10 +14,11 @@ $ terraform apply Note that this example may create resources which cost money. Run `terraform destroy` when you don't need these resources. -<<<<<<< HEAD -## IAM Permission - -The Policy required is: + + +## Requirements + +| Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | | [aws](#requirement\_aws) | >= 4.21 | @@ -31,11 +32,7 @@ No providers. | Name | Source | Version | |------|--------|---------| -<<<<<<< HEAD -| [key\_pair](#module\_key\_pair) | ../../ | n/a | -======= -| [key\_pair](#module\_key\_pair) | squareops/terraform-aws-keypair | n/a | ->>>>>>> e0e34e1c6a140fc579082a1e69ac971caff29059 +| [key\_pair](#module\_key\_pair) | squareops/keypair/aws | n/a | ## Resources diff --git a/examples/complete/main.tf b/examples/complete/main.tf index a8a65c4..3d829c5 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -13,7 +13,7 @@ locals { ################################################################################ module "key_pair" { - source = "squareops/terraform-aws-keypair" + source = "squareops/keypair/aws" key_name = format("%s-%s-kp", local.environment, local.name) ssm_parameter_path = format("%s-%s-ssm", local.environment, local.name) #SSM parameter secret name