Commit e6b781e6 authored by Maxim Mironenko's avatar Maxim Mironenko Committed by GitHub

context.tf updated to v0.24.1, minimum required Terraform version bumped to...

context.tf updated to v0.24.1, minimum required Terraform version bumped to 0.13.0 when needed, readme updated (#107)
parent 856c4614
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
# Cloud Posse must review any changes to standard context definition, # Cloud Posse must review any changes to standard context definition,
# but some changes can be rubber-stamped. # but some changes can be rubber-stamped.
**/context.tf @cloudposse/engineering @cloudposse/approvers **/*.tf @cloudposse/engineering @cloudposse/approvers
README.yaml @cloudposse/engineering @cloudposse/approvers
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
......
...@@ -43,3 +43,11 @@ change-template: | ...@@ -43,3 +43,11 @@ change-template: |
template: | template: |
$CHANGES $CHANGES
replacers:
# Remove irrelevant information from Renovate bot
- search: '/---\s+^#.*Renovate configuration(?:.|\n)*?This PR has been generated .*/gm'
replace: ''
# Remove Renovate bot banner image
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'
replace: ''
# https://docs.mergify.io/conditions.html
# https://docs.mergify.io/actions.html
pull_request_rules: pull_request_rules:
- name: "approve automated PRs that have passed checks" - name: "approve automated PRs that have passed checks"
conditions: conditions:
- "check-success~=test/bats" - "author~=^(cloudpossebot|renovate\\[bot\\])$"
- "check-success~=test/readme"
- "check-success~=test/terratest"
- "base=master" - "base=master"
- "author=cloudpossebot" - "-closed"
- "head~=auto-update/.*" - "head~=^(auto-update|renovate)/.*"
- "check-success=test/bats"
- "check-success=test/readme"
- "check-success=test/terratest"
- "check-success=validate-codeowners"
actions: actions:
review: review:
type: "APPROVE" type: "APPROVE"
...@@ -15,16 +19,17 @@ pull_request_rules: ...@@ -15,16 +19,17 @@ pull_request_rules:
- name: "merge automated PRs when approved and tests pass" - name: "merge automated PRs when approved and tests pass"
conditions: conditions:
- "check-success~=test/bats" - "author~=^(cloudpossebot|renovate\\[bot\\])$"
- "check-success~=test/readme"
- "check-success~=test/terratest"
- "base=master" - "base=master"
- "head~=auto-update/.*" - "-closed"
- "head~=^(auto-update|renovate)/.*"
- "check-success=test/bats"
- "check-success=test/readme"
- "check-success=test/terratest"
- "check-success=validate-codeowners"
- "#approved-reviews-by>=1" - "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=0" - "#changes-requested-reviews-by=0"
- "#commented-reviews-by=0" - "#commented-reviews-by=0"
- "base=master"
- "author=cloudpossebot"
actions: actions:
merge: merge:
method: "squash" method: "squash"
...@@ -38,6 +43,7 @@ pull_request_rules: ...@@ -38,6 +43,7 @@ pull_request_rules:
- name: "ask to resolve conflict" - name: "ask to resolve conflict"
conditions: conditions:
- "conflict" - "conflict"
- "-closed"
actions: actions:
comment: comment:
message: "This pull request is now in conflict. Could you fix it @{{author}}? 🙏" message: "This pull request is now in conflict. Could you fix it @{{author}}? 🙏"
......
...@@ -27,17 +27,19 @@ jobs: ...@@ -27,17 +27,19 @@ jobs:
make init make init
make github/init/context.tf make github/init/context.tf
make readme/build make readme/build
echo "::set-output name=create_pull_request=true" echo "::set-output name=create_pull_request::true"
fi fi
else else
echo "This module has not yet been updated to support the context.tf pattern! Please update in order to support automatic updates." echo "This module has not yet been updated to support the context.tf pattern! Please update in order to support automatic updates."
fi fi
- name: Create Pull Request - name: Create Pull Request
if: {{ steps.update.outputs.create_pull_request == 'true' }} if: steps.update.outputs.create_pull_request == 'true'
uses: cloudposse/actions/github/create-pull-request@0.22.0 uses: cloudposse/actions/github/create-pull-request@0.22.0
with: with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
committer: 'cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>'
author: 'cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>'
commit-message: Update context.tf from origin source commit-message: Update context.tf from origin source
title: Update context.tf title: Update context.tf
body: |- body: |-
......
name: "auto-readme"
on:
schedule:
# Update README.md nightly
- cron: '0 4 * * *'
jobs:
update:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update readme
shell: bash
id: update
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
run: |
make init
make readme/build
- name: Create Pull Request
uses: cloudposse/actions/github/create-pull-request@0.20.0
with:
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
commit-message: Update README.md and docs
title: Update README.md and docs
body: |-
## what
This is an auto-generated PR that updates the README.md and docs
## why
To have most recent changes of README.md and doc from origin templates
branch: auto-update/readme
base: master
delete-branch: true
labels: |
auto-update
readme
...@@ -6,7 +6,7 @@ on: ...@@ -6,7 +6,7 @@ on:
- master - master
jobs: jobs:
semver: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Drafts your next Release notes as Pull Requests are merged into "master" # Drafts your next Release notes as Pull Requests are merged into "master"
......
...@@ -9,6 +9,8 @@ jobs: ...@@ -9,6 +9,8 @@ jobs:
- name: "Checkout source code at current commit" - name: "Checkout source code at current commit"
uses: actions/checkout@v2 uses: actions/checkout@v2
- uses: mszostok/codeowners-validator@v0.5.0 - uses: mszostok/codeowners-validator@v0.5.0
if: github.event.pull_request.head.repo.full_name == github.repository
name: "Full check of CODEOWNERS"
with: with:
# For now, remove "files" check to allow CODEOWNERS to specify non-existent # For now, remove "files" check to allow CODEOWNERS to specify non-existent
# files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos # files so we can use the same CODEOWNERS file for Terraform and non-Terraform repos
...@@ -16,3 +18,8 @@ jobs: ...@@ -16,3 +18,8 @@ jobs:
checks: "syntax,owners,duppatterns" checks: "syntax,owners,duppatterns"
# GitHub access token is required only if the `owners` check is enabled # GitHub access token is required only if the `owners` check is enabled
github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}" github_access_token: "${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}"
- uses: mszostok/codeowners-validator@v0.5.0
if: github.event.pull_request.head.repo.full_name != github.repository
name: "Syntax check of CODEOWNERS"
with:
checks: "syntax,duppatterns"
...@@ -185,7 +185,7 @@ Available targets: ...@@ -185,7 +185,7 @@ Available targets:
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| terraform | >= 0.12.26 | | terraform | >= 0.13.0 |
| aws | >= 2.0 | | aws | >= 2.0 |
| null | >= 2.0 | | null | >= 2.0 |
...@@ -216,7 +216,7 @@ Available targets: ...@@ -216,7 +216,7 @@ Available targets:
| cluster\_mode\_num\_node\_groups | Number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications | `number` | `0` | no | | cluster\_mode\_num\_node\_groups | Number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications | `number` | `0` | no |
| cluster\_mode\_replicas\_per\_node\_group | Number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource | `number` | `0` | no | | cluster\_mode\_replicas\_per\_node\_group | Number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource | `number` | `0` | no |
| cluster\_size | Number of nodes in cluster. \*Ignored when `cluster_mode_enabled` == `true`\* | `number` | `1` | no | | cluster\_size | Number of nodes in cluster. \*Ignored when `cluster_mode_enabled` == `true`\* | `number` | `1` | no |
| context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | <pre>object({<br> enabled = bool<br> namespace = string<br> environment = string<br> stage = string<br> name = string<br> delimiter = string<br> attributes = list(string)<br> tags = map(string)<br> additional_tag_map = map(string)<br> regex_replace_chars = string<br> label_order = list(string)<br> id_length_limit = number<br> })</pre> | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_order": [],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no | | context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no |
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | | delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
| dns\_subdomain | The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name. | `string` | `""` | no | | dns\_subdomain | The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name. | `string` | `""` | no |
| egress\_cidr\_blocks | Outbound traffic address | `list` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no | | egress\_cidr\_blocks | Outbound traffic address | `list` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
...@@ -226,10 +226,12 @@ Available targets: ...@@ -226,10 +226,12 @@ Available targets:
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | | environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
| existing\_security\_groups | List of existing Security Group IDs to place the cluster into. Set `use_existing_security_groups` to `true` to enable using `existing_security_groups` as Security Groups for the cluster | `list(string)` | `[]` | no | | existing\_security\_groups | List of existing Security Group IDs to place the cluster into. Set `use_existing_security_groups` to `true` to enable using `existing_security_groups` as Security Groups for the cluster | `list(string)` | `[]` | no |
| family | Redis family | `string` | `"redis4.0"` | no | | family | Redis family | `string` | `"redis4.0"` | no |
| id\_length\_limit | Limit `id` to this many characters.<br>Set to `0` for unlimited length.<br>Set to `null` for default, which is `0`.<br>Does not affect `id_full`. | `number` | `null` | no | | id\_length\_limit | Limit `id` to this many characters (minimum 6).<br>Set to `0` for unlimited length.<br>Set to `null` for default, which is `0`.<br>Does not affect `id_full`. | `number` | `null` | no |
| instance\_type | Elastic cache instance type | `string` | `"cache.t2.micro"` | no | | instance\_type | Elastic cache instance type | `string` | `"cache.t2.micro"` | no |
| kms\_key\_id | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. `at_rest_encryption_enabled` must be set to `true` | `string` | `null` | no | | kms\_key\_id | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. `at_rest_encryption_enabled` must be set to `true` | `string` | `null` | no |
| label\_key\_case | The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.<br>Possible values: `lower`, `title`, `upper`.<br>Default value: `title`. | `string` | `null` | no |
| label\_order | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no | | label\_order | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no |
| label\_value\_case | The letter case of output label values (also used in `tags` and `id`).<br>Possible values: `lower`, `title`, `upper` and `none` (no transformation).<br>Default value: `lower`. | `string` | `null` | no |
| maintenance\_window | Maintenance window | `string` | `"wed:03:00-wed:04:00"` | no | | maintenance\_window | Maintenance window | `string` | `"wed:03:00-wed:04:00"` | no |
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no | | name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no | | namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
module "this" { module "this" {
source = "cloudposse/label/null" source = "cloudposse/label/null"
version = "0.22.1" // requires Terraform >= 0.12.26 version = "0.24.1" # requires Terraform >= 0.13.0
enabled = var.enabled enabled = var.enabled
namespace = var.namespace namespace = var.namespace
...@@ -34,6 +34,8 @@ module "this" { ...@@ -34,6 +34,8 @@ module "this" {
label_order = var.label_order label_order = var.label_order
regex_replace_chars = var.regex_replace_chars regex_replace_chars = var.regex_replace_chars
id_length_limit = var.id_length_limit id_length_limit = var.id_length_limit
label_key_case = var.label_key_case
label_value_case = var.label_value_case
context = var.context context = var.context
} }
...@@ -41,20 +43,7 @@ module "this" { ...@@ -41,20 +43,7 @@ module "this" {
# Copy contents of cloudposse/terraform-null-label/variables.tf here # Copy contents of cloudposse/terraform-null-label/variables.tf here
variable "context" { variable "context" {
type = object({ type = any
enabled = bool
namespace = string
environment = string
stage = string
name = string
delimiter = string
attributes = list(string)
tags = map(string)
additional_tag_map = map(string)
regex_replace_chars = string
label_order = list(string)
id_length_limit = number
})
default = { default = {
enabled = true enabled = true
namespace = null namespace = null
...@@ -68,6 +57,8 @@ variable "context" { ...@@ -68,6 +57,8 @@ variable "context" {
regex_replace_chars = null regex_replace_chars = null
label_order = [] label_order = []
id_length_limit = null id_length_limit = null
label_key_case = null
label_value_case = null
} }
description = <<-EOT description = <<-EOT
Single object for setting entire context at once. Single object for setting entire context at once.
...@@ -76,6 +67,16 @@ variable "context" { ...@@ -76,6 +67,16 @@ variable "context" {
Individual variable settings (non-null) override settings in context object, Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional_tag_map, which are merged. except for attributes, tags, and additional_tag_map, which are merged.
EOT EOT
validation {
condition = lookup(var.context, "label_key_case", null) == null ? true : contains(["lower", "title", "upper"], var.context["label_key_case"])
error_message = "Allowed values: `lower`, `title`, `upper`."
}
validation {
condition = lookup(var.context, "label_value_case", null) == null ? true : contains(["lower", "title", "upper", "none"], var.context["label_value_case"])
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
}
} }
variable "enabled" { variable "enabled" {
...@@ -158,11 +159,44 @@ variable "id_length_limit" { ...@@ -158,11 +159,44 @@ variable "id_length_limit" {
type = number type = number
default = null default = null
description = <<-EOT description = <<-EOT
Limit `id` to this many characters. Limit `id` to this many characters (minimum 6).
Set to `0` for unlimited length. Set to `0` for unlimited length.
Set to `null` for default, which is `0`. Set to `null` for default, which is `0`.
Does not affect `id_full`. Does not affect `id_full`.
EOT EOT
validation {
condition = var.id_length_limit == null ? true : var.id_length_limit >= 6 || var.id_length_limit == 0
error_message = "The id_length_limit must be >= 6 if supplied (not null), or 0 for unlimited length."
}
}
variable "label_key_case" {
type = string
default = null
description = <<-EOT
The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.
Possible values: `lower`, `title`, `upper`.
Default value: `title`.
EOT
validation {
condition = var.label_key_case == null ? true : contains(["lower", "title", "upper"], var.label_key_case)
error_message = "Allowed values: `lower`, `title`, `upper`."
}
} }
variable "label_value_case" {
type = string
default = null
description = <<-EOT
The letter case of output label values (also used in `tags` and `id`).
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Default value: `lower`.
EOT
validation {
condition = var.label_value_case == null ? true : contains(["lower", "title", "upper", "none"], var.label_value_case)
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
}
}
#### End of copy of cloudposse/terraform-null-label/variables.tf #### End of copy of cloudposse/terraform-null-label/variables.tf
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
| Name | Version | | Name | Version |
|------|---------| |------|---------|
| terraform | >= 0.12.26 | | terraform | >= 0.13.0 |
| aws | >= 2.0 | | aws | >= 2.0 |
| null | >= 2.0 | | null | >= 2.0 |
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
| cluster\_mode\_num\_node\_groups | Number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications | `number` | `0` | no | | cluster\_mode\_num\_node\_groups | Number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications | `number` | `0` | no |
| cluster\_mode\_replicas\_per\_node\_group | Number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource | `number` | `0` | no | | cluster\_mode\_replicas\_per\_node\_group | Number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource | `number` | `0` | no |
| cluster\_size | Number of nodes in cluster. \*Ignored when `cluster_mode_enabled` == `true`\* | `number` | `1` | no | | cluster\_size | Number of nodes in cluster. \*Ignored when `cluster_mode_enabled` == `true`\* | `number` | `1` | no |
| context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | <pre>object({<br> enabled = bool<br> namespace = string<br> environment = string<br> stage = string<br> name = string<br> delimiter = string<br> attributes = list(string)<br> tags = map(string)<br> additional_tag_map = map(string)<br> regex_replace_chars = string<br> label_order = list(string)<br> id_length_limit = number<br> })</pre> | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_order": [],<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no | | context | Single object for setting entire context at once.<br>See description of individual variables for details.<br>Leave string and numeric variables as `null` to use default value.<br>Individual variable settings (non-null) override settings in context object,<br>except for attributes, tags, and additional\_tag\_map, which are merged. | `any` | <pre>{<br> "additional_tag_map": {},<br> "attributes": [],<br> "delimiter": null,<br> "enabled": true,<br> "environment": null,<br> "id_length_limit": null,<br> "label_key_case": null,<br> "label_order": [],<br> "label_value_case": null,<br> "name": null,<br> "namespace": null,<br> "regex_replace_chars": null,<br> "stage": null,<br> "tags": {}<br>}</pre> | no |
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no | | delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`.<br>Defaults to `-` (hyphen). Set to `""` to use no delimiter at all. | `string` | `null` | no |
| dns\_subdomain | The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name. | `string` | `""` | no | | dns\_subdomain | The subdomain to use for the CNAME record. If not provided then the CNAME record will use var.name. | `string` | `""` | no |
| egress\_cidr\_blocks | Outbound traffic address | `list` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no | | egress\_cidr\_blocks | Outbound traffic address | `list` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
...@@ -44,10 +44,12 @@ ...@@ -44,10 +44,12 @@
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no | | environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
| existing\_security\_groups | List of existing Security Group IDs to place the cluster into. Set `use_existing_security_groups` to `true` to enable using `existing_security_groups` as Security Groups for the cluster | `list(string)` | `[]` | no | | existing\_security\_groups | List of existing Security Group IDs to place the cluster into. Set `use_existing_security_groups` to `true` to enable using `existing_security_groups` as Security Groups for the cluster | `list(string)` | `[]` | no |
| family | Redis family | `string` | `"redis4.0"` | no | | family | Redis family | `string` | `"redis4.0"` | no |
| id\_length\_limit | Limit `id` to this many characters.<br>Set to `0` for unlimited length.<br>Set to `null` for default, which is `0`.<br>Does not affect `id_full`. | `number` | `null` | no | | id\_length\_limit | Limit `id` to this many characters (minimum 6).<br>Set to `0` for unlimited length.<br>Set to `null` for default, which is `0`.<br>Does not affect `id_full`. | `number` | `null` | no |
| instance\_type | Elastic cache instance type | `string` | `"cache.t2.micro"` | no | | instance\_type | Elastic cache instance type | `string` | `"cache.t2.micro"` | no |
| kms\_key\_id | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. `at_rest_encryption_enabled` must be set to `true` | `string` | `null` | no | | kms\_key\_id | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. `at_rest_encryption_enabled` must be set to `true` | `string` | `null` | no |
| label\_key\_case | The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.<br>Possible values: `lower`, `title`, `upper`.<br>Default value: `title`. | `string` | `null` | no |
| label\_order | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no | | label\_order | The naming order of the id output and Name tag.<br>Defaults to ["namespace", "environment", "stage", "name", "attributes"].<br>You can omit any of the 5 elements, but at least one must be present. | `list(string)` | `null` | no |
| label\_value\_case | The letter case of output label values (also used in `tags` and `id`).<br>Possible values: `lower`, `title`, `upper` and `none` (no transformation).<br>Default value: `lower`. | `string` | `null` | no |
| maintenance\_window | Maintenance window | `string` | `"wed:03:00-wed:04:00"` | no | | maintenance\_window | Maintenance window | `string` | `"wed:03:00-wed:04:00"` | no |
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no | | name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no | | namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
module "this" { module "this" {
source = "cloudposse/label/null" source = "cloudposse/label/null"
version = "0.22.1" // requires Terraform >= 0.12.26 version = "0.24.1" # requires Terraform >= 0.13.0
enabled = var.enabled enabled = var.enabled
namespace = var.namespace namespace = var.namespace
...@@ -34,6 +34,8 @@ module "this" { ...@@ -34,6 +34,8 @@ module "this" {
label_order = var.label_order label_order = var.label_order
regex_replace_chars = var.regex_replace_chars regex_replace_chars = var.regex_replace_chars
id_length_limit = var.id_length_limit id_length_limit = var.id_length_limit
label_key_case = var.label_key_case
label_value_case = var.label_value_case
context = var.context context = var.context
} }
...@@ -41,20 +43,7 @@ module "this" { ...@@ -41,20 +43,7 @@ module "this" {
# Copy contents of cloudposse/terraform-null-label/variables.tf here # Copy contents of cloudposse/terraform-null-label/variables.tf here
variable "context" { variable "context" {
type = object({ type = any
enabled = bool
namespace = string
environment = string
stage = string
name = string
delimiter = string
attributes = list(string)
tags = map(string)
additional_tag_map = map(string)
regex_replace_chars = string
label_order = list(string)
id_length_limit = number
})
default = { default = {
enabled = true enabled = true
namespace = null namespace = null
...@@ -68,6 +57,8 @@ variable "context" { ...@@ -68,6 +57,8 @@ variable "context" {
regex_replace_chars = null regex_replace_chars = null
label_order = [] label_order = []
id_length_limit = null id_length_limit = null
label_key_case = null
label_value_case = null
} }
description = <<-EOT description = <<-EOT
Single object for setting entire context at once. Single object for setting entire context at once.
...@@ -76,6 +67,16 @@ variable "context" { ...@@ -76,6 +67,16 @@ variable "context" {
Individual variable settings (non-null) override settings in context object, Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional_tag_map, which are merged. except for attributes, tags, and additional_tag_map, which are merged.
EOT EOT
validation {
condition = lookup(var.context, "label_key_case", null) == null ? true : contains(["lower", "title", "upper"], var.context["label_key_case"])
error_message = "Allowed values: `lower`, `title`, `upper`."
}
validation {
condition = lookup(var.context, "label_value_case", null) == null ? true : contains(["lower", "title", "upper", "none"], var.context["label_value_case"])
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
}
} }
variable "enabled" { variable "enabled" {
...@@ -158,11 +159,44 @@ variable "id_length_limit" { ...@@ -158,11 +159,44 @@ variable "id_length_limit" {
type = number type = number
default = null default = null
description = <<-EOT description = <<-EOT
Limit `id` to this many characters. Limit `id` to this many characters (minimum 6).
Set to `0` for unlimited length. Set to `0` for unlimited length.
Set to `null` for default, which is `0`. Set to `null` for default, which is `0`.
Does not affect `id_full`. Does not affect `id_full`.
EOT EOT
validation {
condition = var.id_length_limit == null ? true : var.id_length_limit >= 6 || var.id_length_limit == 0
error_message = "The id_length_limit must be >= 6 if supplied (not null), or 0 for unlimited length."
}
}
variable "label_key_case" {
type = string
default = null
description = <<-EOT
The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.
Possible values: `lower`, `title`, `upper`.
Default value: `title`.
EOT
validation {
condition = var.label_key_case == null ? true : contains(["lower", "title", "upper"], var.label_key_case)
error_message = "Allowed values: `lower`, `title`, `upper`."
}
} }
variable "label_value_case" {
type = string
default = null
description = <<-EOT
The letter case of output label values (also used in `tags` and `id`).
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
Default value: `lower`.
EOT
validation {
condition = var.label_value_case == null ? true : contains(["lower", "title", "upper", "none"], var.label_value_case)
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
}
}
#### End of copy of cloudposse/terraform-null-label/variables.tf #### End of copy of cloudposse/terraform-null-label/variables.tf
terraform { terraform {
required_version = ">= 0.12.26" required_version = ">= 0.13.0"
required_providers { required_providers {
aws = { aws = {
......
...@@ -162,7 +162,7 @@ resource "aws_cloudwatch_metric_alarm" "cache_memory" { ...@@ -162,7 +162,7 @@ resource "aws_cloudwatch_metric_alarm" "cache_memory" {
module "dns" { module "dns" {
source = "cloudposse/route53-cluster-hostname/aws" source = "cloudposse/route53-cluster-hostname/aws"
version = "0.10.1" version = "0.12.0"
enabled = module.this.enabled && var.zone_id != "" ? true : false enabled = module.this.enabled && var.zone_id != "" ? true : false
dns_name = var.dns_subdomain != "" ? var.dns_subdomain : module.this.id dns_name = var.dns_subdomain != "" ? var.dns_subdomain : module.this.id
......
terraform { terraform {
required_version = ">= 0.12.26" required_version = ">= 0.13.0"
required_providers { required_providers {
aws = { aws = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment