Skip to content

Commit 647f942

Browse files
authored
Update terraform-null-label version. Add regex_replace_chars variable (#16)
1 parent ba692ef commit 647f942

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Available targets:
137137
| name | Solution name, e.g. 'app' or 'jenkins' | string | `terraform` | no |
138138
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | `` | no |
139139
| read_capacity | DynamoDB read capacity units | string | `5` | no |
140+
| regex_replace_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`. By default only hyphens, letters and digits are allowed, all other chars are removed | string | `/[^a-zA-Z0-9-]/` | no |
140141
| region | AWS Region the S3 bucket should reside in | string | - | yes |
141142
| restrict_public_buckets | Whether Amazon S3 should restrict public bucket policies for this bucket. | string | `false` | no |
142143
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |

docs/terraform.md

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
| name | Solution name, e.g. 'app' or 'jenkins' | string | `terraform` | no |
1919
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | `` | no |
2020
| read_capacity | DynamoDB read capacity units | string | `5` | no |
21+
| regex_replace_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`. By default only hyphens, letters and digits are allowed, all other chars are removed | string | `/[^a-zA-Z0-9-]/` | no |
2122
| region | AWS Region the S3 bucket should reside in | string | - | yes |
2223
| restrict_public_buckets | Whether Amazon S3 should restrict public bucket policies for this bucket. | string | `false` | no |
2324
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |

main.tf

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
module "base_label" {
2-
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.5.3"
3-
namespace = "${var.namespace}"
4-
environment = "${var.environment}"
5-
stage = "${var.stage}"
6-
name = "${var.name}"
7-
delimiter = "${var.delimiter}"
8-
attributes = "${var.attributes}"
9-
tags = "${var.tags}"
10-
additional_tag_map = "${var.additional_tag_map}"
11-
context = "${var.context}"
12-
label_order = "${var.label_order}"
2+
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.6.3"
3+
namespace = "${var.namespace}"
4+
environment = "${var.environment}"
5+
stage = "${var.stage}"
6+
name = "${var.name}"
7+
delimiter = "${var.delimiter}"
8+
attributes = "${var.attributes}"
9+
tags = "${var.tags}"
10+
additional_tag_map = "${var.additional_tag_map}"
11+
context = "${var.context}"
12+
label_order = "${var.label_order}"
13+
regex_replace_chars = "${var.regex_replace_chars}"
1314
}
1415

1516
module "s3_bucket_label" {
16-
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.5.3"
17+
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.6.3"
1718
context = "${module.base_label.context}"
1819
}
1920

@@ -48,7 +49,7 @@ resource "aws_s3_bucket_public_access_block" "default" {
4849
}
4950

5051
module "dynamodb_table_label" {
51-
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.5.3"
52+
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.6.3"
5253
context = "${module.base_label.context}"
5354
attributes = ["${compact(concat(var.attributes, list("lock")))}"]
5455
}

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,9 @@ variable "restrict_public_buckets" {
113113
description = "Whether Amazon S3 should restrict public bucket policies for this bucket."
114114
default = false
115115
}
116+
117+
variable "regex_replace_chars" {
118+
type = "string"
119+
default = "/[^a-zA-Z0-9-]/"
120+
description = "Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`. By default only hyphens, letters and digits are allowed, all other chars are removed"
121+
}

0 commit comments

Comments
 (0)