Skip to content

Commit 9560bbb

Browse files
chore(deps): update terraform cloudposse/label/null to v0.23.0 (#23)
1 parent 50a1c3f commit 9560bbb

File tree

7 files changed

+101
-11
lines changed

7 files changed

+101
-11
lines changed

.github/workflows/auto-context.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
make init
2828
make github/init/context.tf
2929
make readme/build
30-
echo "::set-output name=create_pull_request=true"
30+
echo "::set-output name=create_pull_request::true"
3131
fi
3232
else
3333
echo "This module has not yet been updated to support the context.tf pattern! Please update in order to support automatic updates."
@@ -38,6 +38,8 @@ jobs:
3838
uses: cloudposse/actions/github/create-pull-request@0.22.0
3939
with:
4040
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
41+
committer: 'cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>'
42+
author: 'cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>'
4143
commit-message: Update context.tf from origin source
4244
title: Update context.tf
4345
body: |-

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Available targets:
177177

178178
| Name | Version |
179179
|------|---------|
180-
| terraform | >= 0.12.26 |
180+
| terraform | >= 0.13 |
181181
| aws | >= 2.0 |
182182

183183
## Providers
@@ -201,7 +201,7 @@ Available targets:
201201
| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no |
202202
| availability\_zone | Availability Zone the instance is launched in. If not set, will be launched in the first AZ of the region | `string` | `""` | no |
203203
| comparison\_operator | The arithmetic operation to use when comparing the specified Statistic and Threshold. Possible values are: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold | `string` | `"GreaterThanOrEqualToThreshold"` | no |
204-
| 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 |
204+
| 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> label_key_case = string<br> label_value_case = string<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_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 |
205205
| create\_default\_security\_group | Create default Security Group with only Egress traffic allowed | `bool` | `true` | no |
206206
| default\_alarm\_action | Default alarm action | `string` | `"action/actions/AWS_EC2.InstanceId.Reboot/1.0"` | no |
207207
| delete\_on\_termination | Whether the volume should be destroyed on instance termination | `bool` | `true` | no |
@@ -225,7 +225,9 @@ Available targets:
225225
| ipv6\_address\_count | Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet | `number` | `0` | no |
226226
| ipv6\_addresses | List of IPv6 addresses from the range of the subnet to associate with the primary network interface | `list(string)` | `[]` | no |
227227
| kms\_key\_id | KMS key ID used to encrypt EBS volume. When specifying kms\_key\_id, ebs\_volume\_encrypted needs to be set to true | `string` | `null` | no |
228+
| 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 |
228229
| 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 |
230+
| 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 |
229231
| metadata\_http\_endpoint\_enabled | Whether the metadata service is available | `bool` | `true` | no |
230232
| metadata\_http\_tokens\_required | Whether or not the metadata service requires session tokens, also referred to as Instance Metadata Service Version 2. | `bool` | `true` | no |
231233
| metric\_name | The name for the alarm's associated metric. Allowed values can be found in https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ec2-metricscollected.html | `string` | `"StatusCheckFailed_Instance"` | no |

context.tf

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
# will be null, and `module.this.delimiter` will be `-` (hyphen).
1919
#
2020

21-
2221
module "this" {
2322
source = "cloudposse/label/null"
24-
version = "0.22.0" // requires Terraform >= 0.12.26
23+
version = "0.23.0" // requires Terraform >= 0.13.0
2524

2625
enabled = var.enabled
2726
namespace = var.namespace
@@ -55,6 +54,8 @@ variable "context" {
5554
regex_replace_chars = string
5655
label_order = list(string)
5756
id_length_limit = number
57+
label_key_case = string
58+
label_value_case = string
5859
})
5960
default = {
6061
enabled = true
@@ -69,6 +70,8 @@ variable "context" {
6970
regex_replace_chars = null
7071
label_order = []
7172
id_length_limit = null
73+
label_key_case = null
74+
label_value_case = null
7275
}
7376
description = <<-EOT
7477
Single object for setting entire context at once.
@@ -77,6 +80,16 @@ variable "context" {
7780
Individual variable settings (non-null) override settings in context object,
7881
except for attributes, tags, and additional_tag_map, which are merged.
7982
EOT
83+
84+
validation {
85+
condition = var.context["label_key_case"] == null ? true : contains(["lower", "title", "upper"], var.context["label_key_case"])
86+
error_message = "Allowed values: `lower`, `title`, `upper`."
87+
}
88+
89+
validation {
90+
condition = var.context["label_value_case"] == null ? true : contains(["lower", "title", "upper", "none"], var.context["label_value_case"])
91+
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
92+
}
8093
}
8194

8295
variable "enabled" {
@@ -166,4 +179,33 @@ variable "id_length_limit" {
166179
EOT
167180
}
168181

182+
variable "label_key_case" {
183+
type = string
184+
default = null
185+
description = <<-EOT
186+
The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.
187+
Possible values: `lower`, `title`, `upper`.
188+
Default value: `title`.
189+
EOT
190+
191+
validation {
192+
condition = var.label_key_case == null ? true : contains(["lower", "title", "upper"], var.label_key_case)
193+
error_message = "Allowed values: `lower`, `title`, `upper`."
194+
}
195+
}
196+
197+
variable "label_value_case" {
198+
type = string
199+
default = null
200+
description = <<-EOT
201+
The letter case of output label values (also used in `tags` and `id`).
202+
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
203+
Default value: `lower`.
204+
EOT
205+
206+
validation {
207+
condition = var.label_value_case == null ? true : contains(["lower", "title", "upper", "none"], var.label_value_case)
208+
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
209+
}
210+
}
169211
#### End of copy of cloudposse/terraform-null-label/variables.tf

docs/terraform.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
| Name | Version |
55
|------|---------|
6-
| terraform | >= 0.12.26 |
6+
| terraform | >= 0.13 |
77
| aws | >= 2.0 |
88

99
## Providers
@@ -27,7 +27,7 @@
2727
| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no |
2828
| availability\_zone | Availability Zone the instance is launched in. If not set, will be launched in the first AZ of the region | `string` | `""` | no |
2929
| comparison\_operator | The arithmetic operation to use when comparing the specified Statistic and Threshold. Possible values are: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold | `string` | `"GreaterThanOrEqualToThreshold"` | no |
30-
| 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 |
30+
| 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> label_key_case = string<br> label_value_case = string<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_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 |
3131
| create\_default\_security\_group | Create default Security Group with only Egress traffic allowed | `bool` | `true` | no |
3232
| default\_alarm\_action | Default alarm action | `string` | `"action/actions/AWS_EC2.InstanceId.Reboot/1.0"` | no |
3333
| delete\_on\_termination | Whether the volume should be destroyed on instance termination | `bool` | `true` | no |
@@ -51,7 +51,9 @@
5151
| ipv6\_address\_count | Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet | `number` | `0` | no |
5252
| ipv6\_addresses | List of IPv6 addresses from the range of the subnet to associate with the primary network interface | `list(string)` | `[]` | no |
5353
| kms\_key\_id | KMS key ID used to encrypt EBS volume. When specifying kms\_key\_id, ebs\_volume\_encrypted needs to be set to true | `string` | `null` | no |
54+
| 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 |
5455
| 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 |
56+
| 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 |
5557
| metadata\_http\_endpoint\_enabled | Whether the metadata service is available | `bool` | `true` | no |
5658
| metadata\_http\_tokens\_required | Whether or not the metadata service requires session tokens, also referred to as Instance Metadata Service Version 2. | `bool` | `true` | no |
5759
| metric\_name | The name for the alarm's associated metric. Allowed values can be found in https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ec2-metricscollected.html | `string` | `"StatusCheckFailed_Instance"` | no |

examples/complete/context.tf

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@
1818
# will be null, and `module.this.delimiter` will be `-` (hyphen).
1919
#
2020

21-
2221
module "this" {
2322
source = "cloudposse/label/null"
24-
version = "0.22.0" // requires Terraform >= 0.12.26
23+
version = "0.23.0" // requires Terraform >= 0.13.0
2524

2625
enabled = var.enabled
2726
namespace = var.namespace
@@ -55,6 +54,8 @@ variable "context" {
5554
regex_replace_chars = string
5655
label_order = list(string)
5756
id_length_limit = number
57+
label_key_case = string
58+
label_value_case = string
5859
})
5960
default = {
6061
enabled = true
@@ -69,6 +70,8 @@ variable "context" {
6970
regex_replace_chars = null
7071
label_order = []
7172
id_length_limit = null
73+
label_key_case = null
74+
label_value_case = null
7275
}
7376
description = <<-EOT
7477
Single object for setting entire context at once.
@@ -77,6 +80,16 @@ variable "context" {
7780
Individual variable settings (non-null) override settings in context object,
7881
except for attributes, tags, and additional_tag_map, which are merged.
7982
EOT
83+
84+
validation {
85+
condition = var.context["label_key_case"] == null ? true : contains(["lower", "title", "upper"], var.context["label_key_case"])
86+
error_message = "Allowed values: `lower`, `title`, `upper`."
87+
}
88+
89+
validation {
90+
condition = var.context["label_value_case"] == null ? true : contains(["lower", "title", "upper", "none"], var.context["label_value_case"])
91+
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
92+
}
8093
}
8194

8295
variable "enabled" {
@@ -166,4 +179,33 @@ variable "id_length_limit" {
166179
EOT
167180
}
168181

182+
variable "label_key_case" {
183+
type = string
184+
default = null
185+
description = <<-EOT
186+
The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.
187+
Possible values: `lower`, `title`, `upper`.
188+
Default value: `title`.
189+
EOT
190+
191+
validation {
192+
condition = var.label_key_case == null ? true : contains(["lower", "title", "upper"], var.label_key_case)
193+
error_message = "Allowed values: `lower`, `title`, `upper`."
194+
}
195+
}
196+
197+
variable "label_value_case" {
198+
type = string
199+
default = null
200+
description = <<-EOT
201+
The letter case of output label values (also used in `tags` and `id`).
202+
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
203+
Default value: `lower`.
204+
EOT
205+
206+
validation {
207+
condition = var.label_value_case == null ? true : contains(["lower", "title", "upper", "none"], var.label_value_case)
208+
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
209+
}
210+
}
169211
#### End of copy of cloudposse/terraform-null-label/variables.tf

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ data "aws_ami" "info" {
5959

6060
module "label" {
6161
source = "cloudposse/label/null"
62-
version = "0.22.1"
62+
version = "0.23.0"
6363
tags = { AZ = local.availability_zone }
6464

6565
context = module.this.context

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 0.12.26"
2+
required_version = ">= 0.13"
33

44
required_providers {
55
aws = {

0 commit comments

Comments
 (0)