diff --git a/README.md b/README.md index 39cbec8..eb09a48 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@
This is how I do it. @@ -22,57 +22,102 @@
-![Contributors](https://img.shields.io/github/contributors/bendoerr-terraform-modules/terraform-null-label?color=dark-green) ![Issues](https://img.shields.io/github/issues/bendoerr-terraform-modules/terraform-null-label) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/bendoerr-terraform-modules/terraform-null-label/test.yml) -![GitHub tag (with filter)](https://img.shields.io/github/v/tag/bendoerr-terraform-modules/terraform-null-label?filter=v*) -![License](https://img.shields.io/github/license/bendoerr-terraform-modules/terraform-null-label) +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/graphs/contributors) +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/issues) +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/pulls) +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/actions/workflows/test.yml) +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/actions/workflows/lint.yml) +[](https://registry.terraform.io/modules/bendoerr-terraform-modules/label/null/latest) +[](https://securityscorecards.dev/viewer/?uri=github.com/bendoerr-terraform-modules/terraform-null-label) +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/blob/main/LICENSE.txt) ## About The Project My opinionated label module. +This Terraform module consumes my `terraform-null-context` and produces +consistent names and tags for all of my resources. It implements a strict naming +and tagging convention that follows the format from +[cloudposse/terraform-null-label](https://github.com/cloudposse/terraform-null-label). + +The Cloud Posse label module provides detailed documentation and reasoning +however by itself it has too many knobs and provides more options that I use. +This module configures the Cloud Posse label exactly how I like it while taking +advantage of my context module to carry standard part of the label around. + + + ## Usage -``` +```terraform module "context" { - source = "git@github.com:bendoerr-terraform-modules/terraform-null-context?ref=v0.4.0" - namespace = "brd" - role = "production' + source = "bendoerr-terraform-modules/context/null" + version = "xxx" + namespace = "bd" + role = "production" region = "us-east-1" - project = "example' + project = "example" } -module "label_thing" { - source = "git@github.com:bendoerr-terraform-modules/terraform-null-label?ref=v0.4.0" +module "label" { + source = "bendoerr-terraform-modules/label/null" + version = "xxx" context = module.context.shared - thing = "thing" + name = "function" } -output "label_id" { - // brd-prod-ue1-example-thing - value = module.label_thing.id +resource "aws_lambda_function" "function" { + function_name = module.label.id # bd-prd-ue1-example-function + tags = module.label.tags # { Name: bd-prd-ue1-example-function, + # Namespace: bd, + # Role: production, + # Region: us-east-1, + # Project: example, + # Environment: prod-ue1, + # } + ... } + +resource "aws_route53_record" "function" { + name = "${module.label.dns_name}.${vars.zone_name}" # function.ue1.cloud.bendoerr.me + # assuming vars.zone_name = cloud.bendoerr.me + ... +} +``` + +### Cost + + + +```text +Project: bendoerr-terraform-modules/terraform-null-label + + Name Monthly Qty Unit Monthly Cost + + OVERALL TOTAL $0.00 +────────────────────────────────── +No cloud resources were detected ``` +This module creates no resources and will not generate any cost against any +cloud provider you use. + + ### Requirements | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13 | -### Providers - -No providers. - ### Modules | Name | Source | Version | |------|--------|---------| | [label](#module\_label) | cloudposse/label/null | 0.25.0 | -### Resources - -No resources. - ### Inputs | Name | Description | Type | Default | Required | @@ -96,18 +141,30 @@ No resources. | [project](#output\_project) | Normalized project | | [tags](#output\_tags) | Normalized Tag map | | [tags\_as\_list\_of\_maps](#output\_tags\_as\_list\_of\_maps) | Additional tags as a list of maps, which can be used in several AWS resources | - + ## Roadmap -See the [open issues](https://github.com/bendoerr-terraform-modules/terraform-null-label/issues) for a list of proposed features (and known issues). +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/issues) + +See the +[open issues](https://github.com/bendoerr-terraform-modules/terraform-null-label/issues) +for a list of proposed features (and known issues). ## Contributing -Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**. -* If you have suggestions for adding or removing projects, feel free to [open an issue](https://github.com/bendoerr-terraform-modules/terraform-null-label/issues/new) to discuss it, or directly create a pull request after you edit the *README.md* file with necessary changes. -* Please make sure you check your spelling and grammar. -* Create individual PR for each suggestion. +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/pulls) + +Contributions are what make the open source community such an amazing place to +be learn, inspire, and create. Any contributions you make are **greatly +appreciated**. + +- If you have suggestions for adding or removing projects, feel free to + [open an issue](https://github.com/bendoerr-terraform-modules/terraform-null-label/issues/new) + to discuss it, or directly create a pull request after you edit the + _README.md_ file with necessary changes. +- Please make sure you check your spelling and grammar. +- Create individual PR for each suggestion. ### Creating A Pull Request @@ -119,13 +176,32 @@ Contributions are what make the open source community such an amazing place to b ## License -Distributed under the MIT License. See [LICENSE](https://github.com/bendoerr-terraform-modules/terraform-null-label/blob/main/LICENSE.txt) for more information. +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/blob/main/LICENSE.txt) + +Distributed under the MIT License. See +[LICENSE](https://github.com/bendoerr-terraform-modules/terraform-null-label/blob/main/LICENSE.txt) +for more information. ## Authors -* **Benjamin R. Doerr** - *Terraformer* - [Benjamin R. Doerr](https://github.com/bendoerr/) - *Built Ben's Terraform Modules* +[](https://github.com/bendoerr-terraform-modules/terraform-null-label/graphs/contributors) + +- **Benjamin R. Doerr** - _Terraformer_ - + [Benjamin R. Doerr](https://github.com/bendoerr/) - _Built Ben's Terraform + Modules_ + +## Supported Versions + +Only the latest tagged version is supported. + +## Reporting a Vulnerability + +See [SECURITY.md](SECURITY.md). ## Acknowledgements -* [ShaanCoding (ReadME Generator)](https://github.com/ShaanCoding/ReadME-Generator) -* [CloudPossie (Terraform Null Label - Inspiration)](https://github.com/cloudposse/terraform-null-label) +- [ShaanCoding (ReadME Generator)](https://github.com/ShaanCoding/ReadME-Generator) +- [CloudPossie (Terraform Null Label - Inspiration)](https://github.com/cloudposse/terraform-null-label) +- [OpenSSF - Helping me follow best practices](https://openssf.org/) +- [StepSecurity - Helping me follow best practices](https://app.stepsecurity.io/) +- [Infracost - Better than AWS Calculator](https://www.infracost.io/) diff --git a/docs/usage-dark.png b/docs/usage-dark.png new file mode 100644 index 0000000..4c11670 Binary files /dev/null and b/docs/usage-dark.png differ diff --git a/docs/usage-light.png b/docs/usage-light.png new file mode 100644 index 0000000..ad4183a Binary files /dev/null and b/docs/usage-light.png differ diff --git a/examples/complete/complete.tfvars b/examples/complete/complete.tfvars index 558c962..8cc1b0c 100644 --- a/examples/complete/complete.tfvars +++ b/examples/complete/complete.tfvars @@ -7,7 +7,7 @@ region_short = "uw2" instance = "demo" instance_short = "dmo" project = "test" -attributes = [ +attributes = [ "attr1" ] tags = { diff --git a/examples/complete/ctx.tf b/examples/complete/ctx.tf index b9ff9b6..b5abe5b 100644 --- a/examples/complete/ctx.tf +++ b/examples/complete/ctx.tf @@ -1,6 +1,6 @@ module "context" { - source = "bendoerr-terraform-modules/context/null" - version = "0.4.1" + source = "bendoerr-terraform-modules/context/null" + version = "0.4.1" namespace = var.namespace environment = var.environment role = var.role @@ -18,8 +18,8 @@ output "context" { } module "context_with_proj" { - source = "bendoerr-terraform-modules/context/null" - version = "0.4.1" + source = "bendoerr-terraform-modules/context/null" + version = "0.4.1" namespace = var.namespace environment = var.environment role = var.role diff --git a/examples/complete/variables.tf b/examples/complete/variables.tf index 88e9754..dc03d57 100644 --- a/examples/complete/variables.tf +++ b/examples/complete/variables.tf @@ -1,5 +1,5 @@ variable "namespace" { - type = string + type = string description = <<-EOT Element to ensure resources are generated with names that are globally unique and do not collide. This should be a short key such as initials. @@ -7,8 +7,8 @@ variable "namespace" { } variable "environment" { - type = string - default = "" + type = string + default = "" description = <<-EOT Element to identify the region and/or the role. If not provided this element defaults to