Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 27, 2022
1 parent 4a3bad0 commit a2bbff9
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,38 @@ module "admin_user_bond0007" {
}
```

## Creating Access Keys
The abiltity to create an access key has been incorporated into this module. In order to make it work, you must
provide the `profile` and `pgp_key_file` variables. The `pgp_key` variable is deprecated. You must also have the private
key for the account's GPG key in your keyring.

Here are the variables you need to add:

```hcl
profile = var.profile
pgp_key_file = "./init/tf-gpg-key.b64"
```

This creates a directory `access_keys/{username}`. In that it creates these files
* access\_key.yml
* variables.auto.tfvars

The `access_key.yml` file contains details about the created access key, and a decryption of that key.
This file must **NOT** be commited to git. A `.gitignore` file is created as part of this module under `access_keys`.
You will need to add the `access_key.yml` to `git-secret`:

```script
# create branch
git-secret add access_keys/{username}/*yml
git-secret hide -m
git add access_keys/{username} -A
git commit -a
git push
# do PR
```

The `variables.auto.tfvars` is there to enable this directory to be used for key rotation with the `rotate-keys.py` script.

## Requirements

No requirements.
Expand Down
32 changes: 32 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,38 @@
* # inline_policies = [ { name = "my-policy", policy = data.aws_iam_policy_document.my-policy.json } ]
* }
* ```
*
* ## Creating Access Keys
* The abiltity to create an access key has been incorporated into this module. In order to make it work, you must
* provide the `profile` and `pgp_key_file` variables. The `pgp_key` variable is deprecated. You must also have the private
* key for the account's GPG key in your keyring.
*
* Here are the variables you need to add:
*
* ```hcl
* profile = var.profile
* pgp_key_file = "./init/tf-gpg-key.b64"
* ```
*
* This creates a directory `access_keys/{username}`. In that it creates these files
* * access_key.yml
* * variables.auto.tfvars
*
* The `access_key.yml` file contains details about the created access key, and a decryption of that key.
* This file must **NOT** be commited to git. A `.gitignore` file is created as part of this module under `access_keys`.
* You will need to add the `access_key.yml` to `git-secret`:
*
* ```script
* # create branch
* git-secret add access_keys/{username}/*yml
* git-secret hide -m
* git add access_keys/{username} -A
* git commit -a
* git push
* # do PR
* ```
*
* The `variables.auto.tfvars` is there to enable this directory to be used for key rotation with the `rotate-keys.py` script.
*/

locals {
Expand Down

0 comments on commit a2bbff9

Please sign in to comment.