Skip to content

Commit

Permalink
Merge branch 'qa' into 'main'
Browse files Browse the repository at this point in the history
v1.0.1

See merge request sq-ia/aws/ec2-keypair!8
  • Loading branch information
nitin-yadav-sq committed Jan 31, 2023
2 parents e812528 + ae6dce7 commit d7fff3d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down
15 changes: 6 additions & 9 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- BEGINNING OF PRE-COMMIT-PIKE DOCS HOOK -->
The Policy required is:

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.21 |
Expand All @@ -31,11 +32,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
<<<<<<< HEAD
| <a name="module_key_pair"></a> [key\_pair](#module\_key\_pair) | ../../ | n/a |
=======
| <a name="module_key_pair"></a> [key\_pair](#module\_key\_pair) | squareops/terraform-aws-keypair | n/a |
>>>>>>> e0e34e1c6a140fc579082a1e69ac971caff29059
| <a name="module_key_pair"></a> [key\_pair](#module\_key\_pair) | squareops/keypair/aws | n/a |

## Resources

Expand Down
2 changes: 1 addition & 1 deletion examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d7fff3d

Please sign in to comment.