Skip to content

Commit 33e3be5

Browse files
authored
Support TF 0.12 with pinned GitHub provider 3.0.0 (#64)
1 parent 4f88b5d commit 33e3be5

File tree

11 files changed

+17
-126
lines changed

11 files changed

+17
-126
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Available targets:
208208
209209
| Name | Version |
210210
|------|---------|
211-
| terraform | >= 0.13.0 |
211+
| terraform | >= 0.12.26 |
212212
| aws | >= 2.0 |
213213
| local | >= 1.2 |
214214
| null | >= 2.0 |
@@ -237,22 +237,19 @@ Available targets:
237237
| buildspec | Declaration to use for building the project. [For more info](http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html) | `string` | `""` | no |
238238
| cache\_type | The type of storage that will be used for the AWS CodeBuild project cache. Valid values: NO\_CACHE, LOCAL, and S3. Defaults to S3. If cache\_type is S3, it will create an S3 bucket for storing codebuild cache inside | `string` | `"S3"` | no |
239239
| codestar\_connection\_arn | CodeStar connection ARN required for Bitbucket integration with CodePipeline | `string` | `""` | no |
240-
| 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 |
240+
| 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 |
241241
| 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 |
242242
| ecs\_cluster\_name | ECS Cluster Name | `string` | n/a | yes |
243243
| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
244244
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
245245
| environment\_variables | A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build | <pre>list(object(<br> {<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
246-
| github\_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB\_TOKEN or `github_token`) | `bool` | `false` | no |
247246
| github\_oauth\_token | GitHub OAuth Token with permissions to access private repositories | `string` | `""` | no |
248247
| github\_webhook\_events | A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/) | `list(string)` | <pre>[<br> "push"<br>]</pre> | no |
249248
| github\_webhooks\_token | GitHub OAuth Token with permissions to create webhooks. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable | `string` | `""` | no |
250249
| 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 |
251250
| image\_repo\_name | ECR repository name to store the Docker image built by this module. Used as CodeBuild ENV variable when building Docker images. [For more info](http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html) | `string` | n/a | yes |
252251
| image\_tag | Docker image tag in the ECR repository, e.g. 'latest'. Used as CodeBuild ENV variable when building Docker images. [For more info](http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html) | `string` | `"latest"` | no |
253-
| 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 |
254252
| 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 |
255-
| 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 |
256253
| local\_cache\_modes | Specifies settings that AWS CodeBuild uses to store and reuse build dependencies. Valid values: LOCAL\_SOURCE\_CACHE, LOCAL\_DOCKER\_LAYER\_CACHE, and LOCAL\_CUSTOM\_CACHE | `list(string)` | `[]` | no |
257254
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
258255
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |

context.tf

Lines changed: 1 addition & 44 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.23.0" // requires Terraform >= 0.13.0
23+
version = "0.22.1" // requires Terraform >= 0.12.26
2424

2525
enabled = var.enabled
2626
namespace = var.namespace
@@ -54,8 +54,6 @@ 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
5957
})
6058
default = {
6159
enabled = true
@@ -70,8 +68,6 @@ variable "context" {
7068
regex_replace_chars = null
7169
label_order = []
7270
id_length_limit = null
73-
label_key_case = null
74-
label_value_case = null
7571
}
7672
description = <<-EOT
7773
Single object for setting entire context at once.
@@ -80,16 +76,6 @@ variable "context" {
8076
Individual variable settings (non-null) override settings in context object,
8177
except for attributes, tags, and additional_tag_map, which are merged.
8278
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-
}
9379
}
9480

9581
variable "enabled" {
@@ -179,33 +165,4 @@ variable "id_length_limit" {
179165
EOT
180166
}
181167

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

docs/terraform.md

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

44
| Name | Version |
55
|------|---------|
6-
| terraform | >= 0.13.0 |
6+
| terraform | >= 0.12.26 |
77
| aws | >= 2.0 |
88
| local | >= 1.2 |
99
| null | >= 2.0 |
@@ -32,22 +32,19 @@
3232
| buildspec | Declaration to use for building the project. [For more info](http://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html) | `string` | `""` | no |
3333
| cache\_type | The type of storage that will be used for the AWS CodeBuild project cache. Valid values: NO\_CACHE, LOCAL, and S3. Defaults to S3. If cache\_type is S3, it will create an S3 bucket for storing codebuild cache inside | `string` | `"S3"` | no |
3434
| codestar\_connection\_arn | CodeStar connection ARN required for Bitbucket integration with CodePipeline | `string` | `""` | no |
35-
| 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 |
35+
| 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 |
3636
| 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 |
3737
| ecs\_cluster\_name | ECS Cluster Name | `string` | n/a | yes |
3838
| enabled | Set to false to prevent the module from creating any resources | `bool` | `null` | no |
3939
| environment | Environment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT' | `string` | `null` | no |
4040
| environment\_variables | A list of maps, that contain both the key 'name' and the key 'value' to be used as additional environment variables for the build | <pre>list(object(<br> {<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
41-
| github\_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB\_TOKEN or `github_token`) | `bool` | `false` | no |
4241
| github\_oauth\_token | GitHub OAuth Token with permissions to access private repositories | `string` | `""` | no |
4342
| github\_webhook\_events | A list of events which should trigger the webhook. See a list of [available events](https://developer.github.com/v3/activity/events/types/) | `list(string)` | <pre>[<br> "push"<br>]</pre> | no |
4443
| github\_webhooks\_token | GitHub OAuth Token with permissions to create webhooks. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable | `string` | `""` | no |
4544
| 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 |
4645
| image\_repo\_name | ECR repository name to store the Docker image built by this module. Used as CodeBuild ENV variable when building Docker images. [For more info](http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html) | `string` | n/a | yes |
4746
| image\_tag | Docker image tag in the ECR repository, e.g. 'latest'. Used as CodeBuild ENV variable when building Docker images. [For more info](http://docs.aws.amazon.com/codebuild/latest/userguide/sample-docker.html) | `string` | `"latest"` | no |
48-
| 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 |
4947
| 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 |
50-
| 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 |
5148
| local\_cache\_modes | Specifies settings that AWS CodeBuild uses to store and reuse build dependencies. Valid values: LOCAL\_SOURCE\_CACHE, LOCAL\_DOCKER\_LAYER\_CACHE, and LOCAL\_CUSTOM\_CACHE | `list(string)` | `[]` | no |
5249
| name | Solution name, e.g. 'app' or 'jenkins' | `string` | `null` | no |
5350
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | `string` | `null` | no |

examples/complete/context.tf

Lines changed: 1 addition & 44 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.23.0" // requires Terraform >= 0.13.0
23+
version = "0.22.1" // requires Terraform >= 0.12.26
2424

2525
enabled = var.enabled
2626
namespace = var.namespace
@@ -54,8 +54,6 @@ 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
5957
})
6058
default = {
6159
enabled = true
@@ -70,8 +68,6 @@ variable "context" {
7068
regex_replace_chars = null
7169
label_order = []
7270
id_length_limit = null
73-
label_key_case = null
74-
label_value_case = null
7571
}
7672
description = <<-EOT
7773
Single object for setting entire context at once.
@@ -80,16 +76,6 @@ variable "context" {
8076
Individual variable settings (non-null) override settings in context object,
8177
except for attributes, tags, and additional_tag_map, which are merged.
8278
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-
}
9379
}
9480

9581
variable "enabled" {
@@ -179,33 +165,4 @@ variable "id_length_limit" {
179165
EOT
180166
}
181167

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

examples/complete/fixtures.us-east-2.tfvars

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ container_port_mappings = [
8080

8181
github_oauth_token = "test"
8282

83-
github_anonymous = true
84-
8583
repo_owner = "cloudposse"
8684

8785
repo_name = "terraform-aws-ecs-codepipeline"

examples/complete/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ module "ecs_codepipeline" {
7171
source = "../../"
7272
region = var.region
7373
github_oauth_token = var.github_oauth_token
74-
github_anonymous = var.github_anonymous
7574
repo_owner = var.repo_owner
7675
repo_name = var.repo_name
7776
branch = var.branch

examples/complete/variables.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ variable "github_oauth_token" {
126126
description = "GitHub OAuth Token with permissions to access private repositories"
127127
}
128128

129-
variable "github_anonymous" {
130-
type = bool
131-
description = "Github Anonymous API (if `true`, token must not be set as GITHUB_TOKEN or `github_token`)"
132-
}
133-
134129
variable "repo_owner" {
135130
type = string
136131
description = "GitHub Organization or Username"

examples/complete/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.13.0"
2+
required_version = ">= 0.12.26"
33

44
required_providers {
55
aws = {

0 commit comments

Comments
 (0)