Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ea0a160

Browse files
pwillis-oibryantbiggs
andauthored
fix: Use an empty map as default value for default_capacity_provider_strategy (#326)
* Use a valid default default_capacity_provider_strategy If the default value is null, the module fails with `Error: Iteration over null value`. This changes the default from null to an empty map to avoid this error. * fix: Disallow null and update docs --------- Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
1 parent 52469ed commit ea0a160

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

‎.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
33
rev: v1.99.5
44
hooks:
5-
- id: terraform_fmt
65
- id: terraform_wrapper_module_for_each
6+
- id: terraform_fmt
77
- id: terraform_docs
88
args:
99
- '--args=--lockfile=false'

‎modules/cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ No modules.
177177
| <a name="input_create_cloudwatch_log_group"></a> [create\_cloudwatch\_log\_group](#input\_create\_cloudwatch\_log\_group) | Determines whether a log group is created by this module for the cluster logs. If not, AWS will automatically create one if logging is enabled | `bool` | `true` | no |
178178
| <a name="input_create_task_exec_iam_role"></a> [create\_task\_exec\_iam\_role](#input\_create\_task\_exec\_iam\_role) | Determines whether the ECS task definition IAM role should be created | `bool` | `false` | no |
179179
| <a name="input_create_task_exec_policy"></a> [create\_task\_exec\_policy](#input\_create\_task\_exec\_policy) | Determines whether the ECS task definition IAM policy should be created. This includes permissions included in AmazonECSTaskExecutionRolePolicy as well as access to secrets and SSM parameters | `bool` | `true` | no |
180-
| <a name="input_default_capacity_provider_strategy"></a> [default\_capacity\_provider\_strategy](#input\_default\_capacity\_provider\_strategy) | Map of default capacity provider strategy definitions to use for the cluster | <pre>map(object({<br/> base = optional(number)<br/> name = optional(string) # Will fall back to use map key if not set<br/> weight = optional(number)<br/> }))</pre> | `null` | no |
180+
| <a name="input_default_capacity_provider_strategy"></a> [default\_capacity\_provider\_strategy](#input\_default\_capacity\_provider\_strategy) | Map of default capacity provider strategy definitions to use for the cluster | <pre>map(object({<br/> base = optional(number)<br/> name = optional(string) # Will fall back to use map key if not set<br/> weight = optional(number)<br/> }))</pre> | `{}` | no |
181181
| <a name="input_name"></a> [name](#input\_name) | Name of the cluster (up to 255 letters, numbers, hyphens, and underscores) | `string` | `""` | no |
182182
| <a name="input_region"></a> [region](#input\_region) | Region where the resource(s) will be managed. Defaults to the Region set in the provider configuration | `string` | `null` | no |
183183
| <a name="input_service_connect_defaults"></a> [service\_connect\_defaults](#input\_service\_connect\_defaults) | Configures a default Service Connect namespace | <pre>object({<br/> namespace = string<br/> })</pre> | `null` | no |

‎modules/cluster/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ variable "default_capacity_provider_strategy" {
147147
name = optional(string) # Will fall back to use map key if not set
148148
weight = optional(number)
149149
}))
150-
default = null
150+
default = {}
151+
nullable = false
151152
}
152153

153154
################################################################################

‎wrappers/cluster/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module "wrapper" {
2020
create_cloudwatch_log_group = try(each.value.create_cloudwatch_log_group, var.defaults.create_cloudwatch_log_group, true)
2121
create_task_exec_iam_role = try(each.value.create_task_exec_iam_role, var.defaults.create_task_exec_iam_role, false)
2222
create_task_exec_policy = try(each.value.create_task_exec_policy, var.defaults.create_task_exec_policy, true)
23-
default_capacity_provider_strategy = try(each.value.default_capacity_provider_strategy, var.defaults.default_capacity_provider_strategy, null)
23+
default_capacity_provider_strategy = try(each.value.default_capacity_provider_strategy, var.defaults.default_capacity_provider_strategy, {})
2424
name = try(each.value.name, var.defaults.name, "")
2525
region = try(each.value.region, var.defaults.region, null)
2626
service_connect_defaults = try(each.value.service_connect_defaults, var.defaults.service_connect_defaults, null)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /