Skip to content

Commit

Permalink
Update terraform-null-label version. Add regex_replace_chars vari…
Browse files Browse the repository at this point in the history
…able (#16)
  • Loading branch information
aknysh authored Mar 14, 2019
1 parent ba692ef commit 647f942
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Available targets:
| name | Solution name, e.g. 'app' or 'jenkins' | string | `terraform` | no |
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | `` | no |
| read_capacity | DynamoDB read capacity units | string | `5` | no |
| 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 |
| region | AWS Region the S3 bucket should reside in | string | - | yes |
| restrict_public_buckets | Whether Amazon S3 should restrict public bucket policies for this bucket. | string | `false` | no |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |
Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
| name | Solution name, e.g. 'app' or 'jenkins' | string | `terraform` | no |
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | `` | no |
| read_capacity | DynamoDB read capacity units | string | `5` | no |
| 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 |
| region | AWS Region the S3 bucket should reside in | string | - | yes |
| restrict_public_buckets | Whether Amazon S3 should restrict public bucket policies for this bucket. | string | `false` | no |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |
Expand Down
27 changes: 14 additions & 13 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
module "base_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.5.3"
namespace = "${var.namespace}"
environment = "${var.environment}"
stage = "${var.stage}"
name = "${var.name}"
delimiter = "${var.delimiter}"
attributes = "${var.attributes}"
tags = "${var.tags}"
additional_tag_map = "${var.additional_tag_map}"
context = "${var.context}"
label_order = "${var.label_order}"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.6.3"
namespace = "${var.namespace}"
environment = "${var.environment}"
stage = "${var.stage}"
name = "${var.name}"
delimiter = "${var.delimiter}"
attributes = "${var.attributes}"
tags = "${var.tags}"
additional_tag_map = "${var.additional_tag_map}"
context = "${var.context}"
label_order = "${var.label_order}"
regex_replace_chars = "${var.regex_replace_chars}"
}

module "s3_bucket_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.5.3"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.6.3"
context = "${module.base_label.context}"
}

Expand Down Expand Up @@ -48,7 +49,7 @@ resource "aws_s3_bucket_public_access_block" "default" {
}

module "dynamodb_table_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.5.3"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.6.3"
context = "${module.base_label.context}"
attributes = ["${compact(concat(var.attributes, list("lock")))}"]
}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,9 @@ variable "restrict_public_buckets" {
description = "Whether Amazon S3 should restrict public bucket policies for this bucket."
default = false
}

variable "regex_replace_chars" {
type = "string"
default = "/[^a-zA-Z0-9-]/"
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"
}

0 comments on commit 647f942

Please sign in to comment.