Skip to content

Commit 7d56c34

Browse files
authored
context.tf updated to v0.24.1, minimum required Terraform version bumped to 0.13.0 when needed, readme updated (#29)
1 parent 8618c20 commit 7d56c34

File tree

8 files changed

+135
-55
lines changed

8 files changed

+135
-55
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
# Cloud Posse must review any changes to standard context definition,
1717
# but some changes can be rubber-stamped.
18-
**/context.tf @cloudposse/engineering @cloudposse/approvers
19-
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
20-
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
18+
**/*.tf @cloudposse/engineering @cloudposse/approvers
19+
README.yaml @cloudposse/engineering @cloudposse/approvers
20+
README.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
21+
docs/*.md @cloudposse/engineering @cloudposse/contributors @cloudposse/approvers
2122

2223
# Cloud Posse Admins must review all changes to CODEOWNERS or the mergify configuration
2324
.github/mergify.yml @cloudposse/admins

.github/workflows/lambda.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v2
1616

17-
# Rebuild README
18-
- name: Prepare
19-
shell: bash
20-
run: |
21-
set -ex
22-
make init
23-
make terraform/install
24-
make terraform/get-plugins
25-
make terraform/get-modules
26-
make terraform/lint
27-
make terraform/validate
28-
2917
- name: Build
3018
run: make build
3119

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,25 @@ see: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-domains.html
9090
Initially SES users are in a sandbox environment that has a number of limitations. See:
9191
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/limits.html
9292
93+
## Security & Compliance [<img src="https://cloudposse.com/wp-content/uploads/2020/11/bridgecrew.svg" width="250" align="right" />](https://bridgecrew.io/)
94+
95+
Security scanning is graciously provided by Bridgecrew. Bridgecrew is the leading fully hosted, cloud-native solution providing continuous Terraform security and compliance.
96+
97+
| Benchmark | Description |
98+
|--------|---------------|
99+
| [![Infrastructure Security](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/general)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=INFRASTRUCTURE+SECURITY) | Infrastructure Security Compliance |
100+
| [![CIS KUBERNETES](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/cis_kubernetes)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=CIS+KUBERNETES+V1.5) | Center for Internet Security, KUBERNETES Compliance |
101+
| [![CIS AWS](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/cis_aws)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=CIS+AWS+V1.2) | Center for Internet Security, AWS Compliance |
102+
| [![CIS AZURE](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/cis_azure)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=CIS+AZURE+V1.1) | Center for Internet Security, AZURE Compliance |
103+
| [![PCI-DSS](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/pci)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=PCI-DSS+V3.2) | Payment Card Industry Data Security Standards Compliance |
104+
| [![NIST-800-53](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/nist)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=NIST-800-53) | National Institute of Standards and Technology Compliance |
105+
| [![ISO27001](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/iso)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=ISO27001) | Information Security Management System, ISO/IEC 27001 Compliance |
106+
| [![SOC2](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/soc2)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=SOC2)| Service Organization Control 2 Compliance |
107+
| [![CIS GCP](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/cis_gcp)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=CIS+GCP+V1.1) | Center for Internet Security, GCP Compliance |
108+
| [![HIPAA](https://www.bridgecrew.cloud/badges/github/cloudposse/terraform-aws-ses-lambda-forwarder/hipaa)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=cloudposse%2Fterraform-aws-ses-lambda-forwarder&benchmark=HIPAA) | Health Insurance Portability and Accountability Compliance |
109+
110+
111+
93112
## Usage
94113
95114
@@ -168,7 +187,7 @@ Available targets:
168187

169188
| Name | Version |
170189
|------|---------|
171-
| terraform | >= 0.12.26 |
190+
| terraform | >= 0.13.0 |
172191
| aws | >= 2.0 |
173192
| external | >= 1.2 |
174193
| local | >= 1.3 |
@@ -189,14 +208,16 @@ Available targets:
189208
| artifact\_filename | Artifact filename | `string` | `"lambda.zip"` | no |
190209
| artifact\_url | URL template for the remote artifact | `string` | `"https://artifacts.cloudposse.com/$${module_name}/$${git_ref}/$${filename}"` | no |
191210
| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no |
192-
| 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 |
211+
| 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 |
193212
| 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 |
194213
| domain | Root domain name | `string` | n/a | yes |
195214
| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
196215
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
197216
| forward\_emails | Map of forward emails | `map(list(string))` | <pre>{<br> "[email protected]": [<br> "[email protected]"<br> ]<br>}</pre> | no |
198-
| 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 |
217+
| 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 |
218+
| 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 |
199219
| 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 |
220+
| 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 |
200221
| lambda\_runtime | Lambda runtime | `string` | `"nodejs12.x"` | no |
201222
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
202223
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |

context.tf

Lines changed: 50 additions & 16 deletions
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.24.1" # requires Terraform >= 0.13.0
2424

2525
enabled = var.enabled
2626
namespace = var.namespace
@@ -34,27 +34,16 @@ module "this" {
3434
label_order = var.label_order
3535
regex_replace_chars = var.regex_replace_chars
3636
id_length_limit = var.id_length_limit
37+
label_key_case = var.label_key_case
38+
label_value_case = var.label_value_case
3739

3840
context = var.context
3941
}
4042

4143
# Copy contents of cloudposse/terraform-null-label/variables.tf here
4244

4345
variable "context" {
44-
type = object({
45-
enabled = bool
46-
namespace = string
47-
environment = string
48-
stage = string
49-
name = string
50-
delimiter = string
51-
attributes = list(string)
52-
tags = map(string)
53-
additional_tag_map = map(string)
54-
regex_replace_chars = string
55-
label_order = list(string)
56-
id_length_limit = number
57-
})
46+
type = any
5847
default = {
5948
enabled = true
6049
namespace = null
@@ -68,6 +57,8 @@ variable "context" {
6857
regex_replace_chars = null
6958
label_order = []
7059
id_length_limit = null
60+
label_key_case = null
61+
label_value_case = null
7162
}
7263
description = <<-EOT
7364
Single object for setting entire context at once.
@@ -76,6 +67,16 @@ variable "context" {
7667
Individual variable settings (non-null) override settings in context object,
7768
except for attributes, tags, and additional_tag_map, which are merged.
7869
EOT
70+
71+
validation {
72+
condition = lookup(var.context, "label_key_case", null) == null ? true : contains(["lower", "title", "upper"], var.context["label_key_case"])
73+
error_message = "Allowed values: `lower`, `title`, `upper`."
74+
}
75+
76+
validation {
77+
condition = lookup(var.context, "label_value_case", null) == null ? true : contains(["lower", "title", "upper", "none"], var.context["label_value_case"])
78+
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
79+
}
7980
}
8081

8182
variable "enabled" {
@@ -158,11 +159,44 @@ variable "id_length_limit" {
158159
type = number
159160
default = null
160161
description = <<-EOT
161-
Limit `id` to this many characters.
162+
Limit `id` to this many characters (minimum 6).
162163
Set to `0` for unlimited length.
163164
Set to `null` for default, which is `0`.
164165
Does not affect `id_full`.
165166
EOT
167+
validation {
168+
condition = var.id_length_limit == null ? true : var.id_length_limit >= 6 || var.id_length_limit == 0
169+
error_message = "The id_length_limit must be >= 6 if supplied (not null), or 0 for unlimited length."
170+
}
171+
}
172+
173+
variable "label_key_case" {
174+
type = string
175+
default = null
176+
description = <<-EOT
177+
The letter case of label keys (`tag` names) (i.e. `name`, `namespace`, `environment`, `stage`, `attributes`) to use in `tags`.
178+
Possible values: `lower`, `title`, `upper`.
179+
Default value: `title`.
180+
EOT
181+
182+
validation {
183+
condition = var.label_key_case == null ? true : contains(["lower", "title", "upper"], var.label_key_case)
184+
error_message = "Allowed values: `lower`, `title`, `upper`."
185+
}
166186
}
167187

188+
variable "label_value_case" {
189+
type = string
190+
default = null
191+
description = <<-EOT
192+
The letter case of output label values (also used in `tags` and `id`).
193+
Possible values: `lower`, `title`, `upper` and `none` (no transformation).
194+
Default value: `lower`.
195+
EOT
196+
197+
validation {
198+
condition = var.label_value_case == null ? true : contains(["lower", "title", "upper", "none"], var.label_value_case)
199+
error_message = "Allowed values: `lower`, `title`, `upper`, `none`."
200+
}
201+
}
168202
#### End of copy of cloudposse/terraform-null-label/variables.tf

docs/terraform.md

Lines changed: 5 additions & 3 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
| external | >= 1.2 |
99
| local | >= 1.3 |
@@ -24,14 +24,16 @@
2424
| artifact\_filename | Artifact filename | `string` | `"lambda.zip"` | no |
2525
| artifact\_url | URL template for the remote artifact | `string` | `"https://artifacts.cloudposse.com/$${module_name}/$${git_ref}/$${filename}"` | no |
2626
| attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no |
27-
| 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 |
27+
| 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 |
2828
| 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 |
2929
| domain | Root domain name | `string` | n/a | yes |
3030
| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
3131
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
3232
| forward\_emails | Map of forward emails | `map(list(string))` | <pre>{<br> "[email protected]": [<br> "[email protected]"<br> ]<br>}</pre> | no |
33-
| 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 |
33+
| 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 |
34+
| 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 |
3435
| 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 |
36+
| 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 |
3537
| lambda\_runtime | Lambda runtime | `string` | `"nodejs12.x"` | no |
3638
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
3739
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |

0 commit comments

Comments
 (0)