Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Andriy Knysh <[email protected]>
Co-authored-by: Yonatan Koren <[email protected]>
  • Loading branch information
3 people authored Aug 17, 2021
1 parent ffaeb6a commit 59f0243
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ description: |-
So if you prefer the term `stage` to `environment` and do not need `tenant`, you can exclude them
and the label `id` will look like `{namespace}-{stage}-{name}-{attributes}`.
- If `attributes` and `tenant` are excluded but `namespace`, `stage`, and `environment` are included, `id` will look like `{namespace}-{environment}-{stage}-{name}`.
Excluding `attributes` is discouraged, though, because attributes are the main way modules modify the ID to ensure uniqueness.
Excluding `attributes` is discouraged, though, because attributes are the main way modules modify the ID to ensure uniqueness when provisioning the same resource types.
- If you want the label items in a different order, you can specify that, too, with the `label_order` list.
- You can set a maximum length for the `id`, and the module will create a (probably) unique name that fits within that length.
(The module uses a portion of the MD5 hash of the full `id` to represent the missing part, so there remains a slight chance of name collision.)
Expand All @@ -35,7 +35,7 @@ description: |-
Unlike the tags generated from the label inputs, tags passed in via the `tags` input are not modified.
There is an unforunate collision over the use of the label/key `name`. Cloud Posse uses `name` in this module
There is an unfortunate collision over the use of the key `name`. Cloud Posse uses `name` in this module
to represent the component, such as `eks` or `rds`. AWS uses a tag with the key `Name` to store the full human-friendly
identifier of the thing tagged, which this module outputs as `id`, not `name`. So when converting input labels
to tags, the value of the `Name` key is set to the module `id` output, and there is no tag corresponding to the
Expand All @@ -47,9 +47,9 @@ description: |-
All [Cloud Posse Terraform modules](https://github.com/cloudposse?utf8=%E2%9C%93&q=terraform-&type=&language=) use this module to ensure resources can be instantiated multiple times within an account and without conflict.
Cloud Posse convention is to use the labels like this:
The Cloud Posse convention is to use labels as follows:
- `namespace`: A short (3-4 letters) abbreviation of the company name, to ensure globally unique IDs for things like S3 buckets
- `tenant`: Usually omitted. For resources dedicated to a customer or subsidiary but housed in the company's accounts, a short code to identify the customer
- `tenant`: _(Rarely needed)_ When a company creates a dedicated resource per customer, `tenant` can be used to identify the customer the resource is dedicated to
- `environment`: A [short abbreviation](https://github.com/cloudposse/terraform-aws-utils/#introduction) for the AWS region hosting the resource, or `gbl` for resources like IAM roles that have no region
- `stage`: The name or role of the account the resource is for, such as `prod` or `dev`
- `name`: The name of the component that owns the resources, such as `eks` or `rds`
Expand Down
2 changes: 1 addition & 1 deletion examples/complete/context.tf
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ variable "namespace" {
variable "tenant" {
type = string
default = null
description = "Usually omitted, but available for distinguishing resources dedicated to a specific customer"
description = "_(Rarely used)_ A customer identifier, indicating who this instance of a resource is for"
}

variable "environment" {
Expand Down
2 changes: 1 addition & 1 deletion exports/context.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ variable "namespace" {
variable "tenant" {
type = string
default = null
description = "Usually omitted, but available for distinguishing resources dedicated to a specific customer"
description = "_(Rarely used)_ A customer identifier, indicating who this instance of a resource is for"
}

variable "environment" {
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ variable "namespace" {
variable "tenant" {
type = string
default = null
description = "Usually omitted, but available for distinguishing resources dedicated to a specific customer"
description = "_(Rarely used)_ A customer identifier, indicating who this instance of a resource is for"
}

variable "environment" {
Expand Down

0 comments on commit 59f0243

Please sign in to comment.