Skip to content

Commit 519a3cf

Browse files
adding profile and run instructions
1 parent ecf8ad9 commit 519a3cf

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

docs/Infrastructure_Guide/terraform.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,42 @@ After manually creating the resources in the [AWS](aws.md) section, [terraformer
3030
Terraformer acts as a "reverse Terraform" tool where it can read from created resources on AWS.
3131
Although the output can sometimes be a bit verbose, it's an easy way to capture everything to create reproducible builds.
3232

33+
### Profile
34+
Before installing Terraformer, a profile from AWS will need to be configured under `~/.aws/credentials` which is `TOML` like file.
35+
36+
Configure the `terraform-user` profile from [1. AWS](aws.md#iam) to look like this:
37+
38+
```toml
39+
[terraform-user]
40+
aws_access_key_id = <ACCESS_KEY_ID>
41+
aws_secret_access_key = <SECRET_ACCESS_KEY>
42+
```
43+
44+
To retrieve these options, head to IAM > Users > teraform-user > Security Credentials tab
45+
3346
### Install
3447
* [Install Guide](https://github.com/GoogleCloudPlatform/terraformer?tab=readme-ov-file#installation)
3548

36-
Install Terraformer:
49+
Install Terraformer on macOS:
3750

3851
```bash
3952
brew install terraformer
4053
```
4154

55+
### Run
56+
57+
Once Terraformer is installed, run the tool to start generated `.tf` files.
58+
59+
For example, to retrieve the build for an RDS instance, run:
60+
61+
```bash
62+
terraformer import aws --regions us-west-2 --resources rds --profile terraform-user
63+
```
64+
65+
Where:
66+
* `--regions `is where the RDS instance is located.
67+
* `--resources` is the resources under RDS
68+
* `--profile` is the `terraform-user` profile from `~/.aws/credentials`
4269

70+
After running this command, Terraformer will create the `.tf` files under `~/generated`.
71+
The path to where these will be created can be changed with the `--path-output` flag.

0 commit comments

Comments
 (0)