An open API service indexing awesome lists of open source software.

https://github.com/iac-factory/terraform-local-parameter

Terraform Cloud Resource Naming + Tagging
https://github.com/iac-factory/terraform-local-parameter

Last synced: 2 months ago
JSON representation

Terraform Cloud Resource Naming + Tagging

Awesome Lists containing this project

README

        

# terraform-local-parameter #

*Anything with a `ⓘ` is a dropdown containing additional, contextual information.*
#### Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [application](#input_application) | ID Element - The Component or Solution's Name | `string` | n/a | yes |
| [namespace](#input_namespace) | ID Element - A Global-Level Identifier. Company Name, Contracting Firm, or Business-Unit - perhaps Cloud-service are Appropriate | `string` | n/a | yes |
| [service](#input_service) | ID Element - Service(s) either Consumed or Provided i.e. EC2, Custom-Microservice-Name, K8s | `string` | n/a | yes |
| [casing](#input_casing) | A Short-Circuit for the `Name` Tag Partial (Value) of the Parameter | `string` | `"none"` | no |
| [environment](#input_environment) | ID Element - `Development`, `QA`, `Staging`, `UAT`, `Pre-Production`, `Production` | `string` | `"Development"` | no |
| [identifier](#input_identifier) | ID Element - An Optional Identifier to Further Define the Resource | `string` | `null` | no |
| [key-casing](#input_key-casing) | n/a | `map(string)` |

{
"application": "title",
"environment": "title",
"identifier": "title",
"name": "none",
"namespace": "title",
"service": "title",
"tf": "upper"
}
| no |
| [name-overwrite](#input_name-overwrite) | A Name Tag Escape Hatch - Useful for Larger, Single Resource Terraform Module(s) | `string` | `null` | no |
| [prefix-separator](#input_prefix-separator) | Prefix the Separator to the Start of the ID String | `bool` | `false` | no |
| [separator](#input_separator) | The ID's Element Separator | `string` | `"-"` | no |
| [suffix-separator](#input_suffix-separator) | Suffix the Separator to the End of the ID String | `bool` | `false` | no |
| [tags](#input_tags) | Additional Tags (e.g. `{'Business-Unit': 'XYZ'}`); Will Overwrite Other Keys Depending on Other Inputs + Tag Keys | `map(string)` | `{}` | no |
| [tf](#input_tf) | Non-ID Element - Tag Setter | `string` | `"True"` | no |
| [value-casing](#input_value-casing) | n/a | `map(string)` |
{
"application": "title",
"environment": "title",
"identifier": "title",
"name": "none",
"namespace": "title",
"service": "title",
"tf": "title"
}
| no |

#### Outputs

| Name | Description |
|------|-------------|
| [application](#output_application) | n/a |
| [environment](#output_environment) | n/a |
| [identifier](#output_identifier) | n/a |
| [input](#output_input) | n/a |
| [name](#output_name) | n/a |
| [namespace](#output_namespace) | n/a |
| [service](#output_service) | n/a |
| [tags](#output_tags) | n/a |

---

## Documentation ##

ⓘ View (Drop-Down)

Documentation is both programmatically and conventionally generated.

**Note** - Given the workflow between `git` & `pre-commit`, when creating
a new commit, ensure to run the following:

```bash
git commit -a --message "..."
```

If a commit shows as a **Failure**, ***such is the job of the pre-commit hook***.
Simply re-commit and then the repository should be able to be pushed to.

### Generating `tfvars` & `tfvars.json` ###

```bash
terraform-docs tfvars hcl "$(git rev-parse --show-toplevel)"

terraform-docs tfvars json "$(git rev-parse --show-toplevel)"
```

### `terraform-docs` ###

In order to install `terraform-docs`, ensure `brew` is installed (for MacOS systems), and run

```bash
brew install terraform-docs
```

If looking to upgrade:

```bash
brew uninstall terraform-docs
brew install terraform-docs
```

It's elected to use `brew uninstall` vs `brew upgrade` because old versions are then removed.

### `git` & `pre-commit` ###

Documentation is often a second thought; refer to the following steps to ensure documentation is always updated
upon `git commit`.

1. Install Pre-Commit
```bash
brew install pre-commit || pip install pre-commit
```
2. Check Installation + Version
```bash
pre-commit --version
```
3. Generate Configuration (`.pre-commit-config.yaml`)
4. Configure `git` hooks
```bash
pre-commit install
pre-commit install-hooks
```
- If any errors show:
```bash
git config --unset-all core.hooksPath
```

**Most Importantly**

> *`pre-commit install` should always be the first command after a project is cloned.*

## References ##

Regardless of involvements with the project, please acknowledge
the following philosophies:

- [**Versioning**](https://semver.org) is not an arbitrarily made up concept ([The 12-Factor Application](https://12factor.net/build-release-run)).
- For better or for worse, it's never okay to affect others without communication.
- *[Documentation](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/4/html/introduction_to_system_administration/s1-philosophy-document)* is no different than code.