generated from terraform-modules/template_aws_module
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from hunte359/patch-1
Update README.md (Moved from DAPPS-ITE account)
- Loading branch information
Showing
1 changed file
with
125 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,126 @@ | ||
| # Examples | ||
| # Instantiating this configuration in another account | ||
|
|
||
| Create directories with specific examples and describe how to use the module in a variety of ways. | ||
| ## Prerequisites | ||
|
|
||
| 1. In the target account, be sure that `GIT-ROOT/.tf-control` shows the `TERRAFORM` variable set | ||
| to `terraform_current`. | ||
| 1. Add service linked roles to `common/` (see module examples) | ||
| 1. Import the account GPG key | ||
| ``` | ||
| # cd TARGET-GIT-ROOT | ||
| cd init/gpg-setup | ||
| git-secret reveal -f | ||
| gpg --import tf-*.gpg.asc tf-*.secret-key | ||
| ``` | ||
|
|
||
| ## Steps to Clone | ||
|
|
||
| * Create the approriate directory in the target account | ||
|
|
||
| ```script | ||
| # cd TARGET-GIT-ROOT | ||
| # make new branch and checkout | ||
| mkdir common/west/apps/ditd-darhts-s3-transfer | ||
| ``` | ||
|
|
||
| * Rsync (not cp) | ||
|
|
||
| ``` | ||
| # cd SOURCE # GitHub location of source: [here](https://github.e.it.census.gov/terraform/260949450014-adsd-dapps-ite-gov/tree/master/common/west/apps/ditd-darhts-s3-transfer) | ||
| rsync -avRWH ./ TARGET-GIT-ROOT/common/west/apps/ditd-darhts-s3-transfer | ||
| ``` | ||
|
|
||
| * Cleanup new directory | ||
|
|
||
| ``` | ||
| # cd TARGET-GIT-ROOT/common/west/apps/ditd-darhts-s3-transfer | ||
| tf-run superclean | ||
| rm -rf access_keys *.secret | ||
| git-secret add api.txt variables.api.auto.tfvars | ||
| ``` | ||
|
|
||
| ## Steps to setup | ||
|
|
||
| * Work in target directory | ||
|
|
||
| ``` | ||
| # cd TARGET-GIT-ROOT/common/west/apps/ditd-darhts-s3-transfer | ||
| ``` | ||
|
|
||
| * Populate files with values | ||
|
|
||
| Add proper information for the new environment, new settings into the files | ||
| * api.txt | ||
| * variables.api.auto.tfvars | ||
| * variables.auto.tfvars | ||
|
|
||
| You can use the variables.auto.tfvars.TEMPLATE file to change just the environent, like this: | ||
|
|
||
| ``` | ||
| sed -e "s/{ENVIRONMENT}/qa/g" variables.auto.tfvars.TEMPLATE > variables.auto.tfvars | ||
| ``` | ||
|
|
||
| * Check the `tags.*.yml` for proper values | ||
|
|
||
| * Process and prepare for PR | ||
|
|
||
| ``` | ||
| tf-run init | ||
| tf-run plan | ||
| git-secret hide -m | ||
| git add . | ||
| ``` | ||
|
|
||
| * Commit | ||
|
|
||
| Commit the branch, push the commit, do the PR, upload the `tf-plan` log and add the | ||
| `tf-plan summary` to the PR body. | ||
|
|
||
| ## Apply and beyond | ||
|
|
||
| * Once you have a merged PR, you may apply. You'll have a few additional steps post-apply | ||
| that need to be again submitted as git PRs. | ||
|
|
||
|
|
||
| # still in your branch | ||
| ``` | ||
| git pull origin master | ||
| tf-run apply | ||
| ``` | ||
|
|
||
| * Add access key to git-secret | ||
|
|
||
| ``` | ||
| git-secret add access_keys/*/access_key.yml | ||
| git-secret hide -m | ||
| git add access_keys | ||
| ``` | ||
|
|
||
| * Commit -a (to get git-secret changes) | ||
|
|
||
| ``` | ||
| git commit -a -m "insert message" | ||
| git push | ||
| ``` | ||
|
|
||
| and again do a PR to merge in all the new files generated. | ||
|
|
||
| You will need to distribute the `access_key.yml` file (encrypted zip) to the POC. | ||
|
|
||
|
|
||
| # CHANGELOG | ||
|
|
||
| - 1.0.0 -- 2025-08-18 | ||
| - initial | ||
|
|
||
| - 1.0.1 -- 2025-08-19 | ||
| - provide template for variables.auto.tfvars | ||
|
|
||
| - 1.0.2 -- 2025-08-19 | ||
| - add git-secret post apply changes | ||
|
|
||
| - 1.0.3 -- 2025-08-19 | ||
| - changed formatting | ||
|
|
||
| - 1.0.4 -- 2025-09-02 | ||
| - changed locaiton to the module repo. Previous location was [DAPS ITE repo](https://github.e.it.census.gov/terraform/260949450014-adsd-dapps-ite-gov/tree/master/common/west/apps/ditd-darhts-s3-transfer) |