Skip to content

Commit 7b25c75

Browse files
authored
minimum required Terraform version bumped to 0.13.0, context.tf updated, readme updated (#27)
1 parent f88d795 commit 7b25c75

File tree

12 files changed

+131
-20
lines changed

12 files changed

+131
-20
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/[email protected]
3939
with:
4040
token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
41+
committer: 'cloudpossebot <[email protected]>'
42+
author: 'cloudpossebot <[email protected]>'
4143
commit-message: Update context.tf from origin source
4244
title: Update context.tf
4345
body: |-

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,25 @@ For example, by using [chamber](https://github.com/segmentio/chamber):
156156
chamber write atlantis github_webhooks_token "....."
157157
```
158158

159+
## Security & Compliance [<img src="https://cloudposse.com/wp-content/uploads/2020/11/bridgecrew.svg" width="250" align="right" />](https://bridgecrew.io/)
160+
161+
Security scanning is graciously provided by Bridgecrew. Bridgecrew is the leading fully hosted, cloud-native solution providing continuous Terraform security and compliance.
162+
163+
| Benchmark | Description |
164+
|--------|---------------|
165+
| [![Infrastructure Security](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/general)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=INFRASTRUCTURE+SECURITY) | Infrastructure Security Compliance |
166+
| [![CIS KUBERNETES](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/cis_kubernetes)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=CIS+KUBERNETES+V1.5) | Center for Internet Security, KUBERNETES Compliance |
167+
| [![CIS AWS](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/cis_aws)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=CIS+AWS+V1.2) | Center for Internet Security, AWS Compliance |
168+
| [![CIS AZURE](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/cis_azure)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=CIS+AZURE+V1.1) | Center for Internet Security, AZURE Compliance |
169+
| [![PCI-DSS](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/pci)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=PCI-DSS+V3.2) | Payment Card Industry Data Security Standards Compliance |
170+
| [![NIST-800-53](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/nist)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=NIST-800-53) | National Institute of Standards and Technology Compliance |
171+
| [![ISO27001](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/iso)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=ISO27001) | Information Security Management System, ISO/IEC 27001 Compliance |
172+
| [![SOC2](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/soc2)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=SOC2)| Service Organization Control 2 Compliance |
173+
| [![CIS GCP](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/cis_gcp)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=CIS+GCP+V1.1) | Center for Internet Security, GCP Compliance |
174+
| [![HIPAA](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ecs-atlantis/hipaa)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ecs-atlantis&benchmark=HIPAA) | Health Insurance Portability and Accountability Compliance |
175+
176+
177+
159178
## Usage
160179

161180

@@ -406,7 +425,7 @@ Available targets:
406425

407426
| Name | Version |
408427
|------|---------|
409-
| terraform | >= 0.12.26 |
428+
| terraform | >= 0.13.0 |
410429
| aws | >= 2.0 |
411430
| random | >= 2.0 |
412431

@@ -477,7 +496,7 @@ Available targets:
477496
| codepipeline\_s3\_bucket\_force\_destroy | A boolean that indicates all objects should be deleted from the CodePipeline artifact store S3 bucket so that the bucket can be destroyed without error | `bool` | `false` | no |
478497
| container\_cpu | Atlantis CPUs per task | `number` | `256` | no |
479498
| container\_memory | Atlantis memory per task | `number` | `512` | no |
480-
| 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 |
499+
| 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 |
481500
| default\_backend\_image | ECS default (bootstrap) image | `string` | `"cloudposse/default-backend:0.1.2"` | no |
482501
| 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 |
483502
| desired\_count | Atlantis desired number of tasks | `number` | `1` | no |
@@ -503,7 +522,9 @@ Available targets:
503522
| hostname | Atlantis URL | `string` | `""` | no |
504523
| 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 |
505524
| kms\_key\_id | KMS key ID used to encrypt SSM SecureString parameters | `string` | `""` | no |
525+
| 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 |
506526
| 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 |
527+
| 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 |
507528
| launch\_type | The ECS launch type (valid options: FARGATE or EC2) | `string` | `"FARGATE"` | no |
508529
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
509530
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |

context.tf

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
module "this" {
2222
source = "cloudposse/label/null"
23-
version = "0.22.1" // requires Terraform >= 0.12.26
23+
version = "0.23.0" // requires Terraform >= 0.13.0
2424

2525
enabled = var.enabled
2626
namespace = var.namespace
@@ -54,6 +54,8 @@ variable "context" {
5454
regex_replace_chars = string
5555
label_order = list(string)
5656
id_length_limit = number
57+
label_key_case = string
58+
label_value_case = string
5759
})
5860
default = {
5961
enabled = true
@@ -68,6 +70,8 @@ variable "context" {
6870
regex_replace_chars = null
6971
label_order = []
7072
id_length_limit = null
73+
label_key_case = null
74+
label_value_case = null
7175
}
7276
description = <<-EOT
7377
Single object for setting entire context at once.
@@ -76,6 +80,16 @@ variable "context" {
7680
Individual variable settings (non-null) override settings in context object,
7781
except for attributes, tags, and additional_tag_map, which are merged.
7882
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+
}
7993
}
8094

8195
variable "enabled" {
@@ -165,4 +179,33 @@ variable "id_length_limit" {
165179
EOT
166180
}
167181

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+
}
168211
#### 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.0 |
77
| aws | >= 2.0 |
88
| random | >= 2.0 |
99

@@ -74,7 +74,7 @@
7474
| codepipeline\_s3\_bucket\_force\_destroy | A boolean that indicates all objects should be deleted from the CodePipeline artifact store S3 bucket so that the bucket can be destroyed without error | `bool` | `false` | no |
7575
| container\_cpu | Atlantis CPUs per task | `number` | `256` | no |
7676
| container\_memory | Atlantis memory per task | `number` | `512` | no |
77-
| 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 |
77+
| 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 |
7878
| default\_backend\_image | ECS default (bootstrap) image | `string` | `"cloudposse/default-backend:0.1.2"` | no |
7979
| 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 |
8080
| desired\_count | Atlantis desired number of tasks | `number` | `1` | no |
@@ -100,7 +100,9 @@
100100
| hostname | Atlantis URL | `string` | `""` | no |
101101
| 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 |
102102
| kms\_key\_id | KMS key ID used to encrypt SSM SecureString parameters | `string` | `""` | no |
103+
| 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 |
103104
| 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 |
105+
| 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 |
104106
| launch\_type | The ECS launch type (valid options: FARGATE or EC2) | `string` | `"FARGATE"` | no |
105107
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
106108
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |

examples/complete/context.tf

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
module "this" {
2222
source = "cloudposse/label/null"
23-
version = "0.22.1" // requires Terraform >= 0.12.26
23+
version = "0.23.0" // requires Terraform >= 0.13.0
2424

2525
enabled = var.enabled
2626
namespace = var.namespace
@@ -54,6 +54,8 @@ variable "context" {
5454
regex_replace_chars = string
5555
label_order = list(string)
5656
id_length_limit = number
57+
label_key_case = string
58+
label_value_case = string
5759
})
5860
default = {
5961
enabled = true
@@ -68,6 +70,8 @@ variable "context" {
6870
regex_replace_chars = null
6971
label_order = []
7072
id_length_limit = null
73+
label_key_case = null
74+
label_value_case = null
7175
}
7276
description = <<-EOT
7377
Single object for setting entire context at once.
@@ -76,6 +80,16 @@ variable "context" {
7680
Individual variable settings (non-null) override settings in context object,
7781
except for attributes, tags, and additional_tag_map, which are merged.
7882
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+
}
7993
}
8094

8195
variable "enabled" {
@@ -165,4 +179,33 @@ variable "id_length_limit" {
165179
EOT
166180
}
167181

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+
}
168211
#### End of copy of cloudposse/terraform-null-label/variables.tf

0 commit comments

Comments
 (0)