Skip to content

Commit 2ace109

Browse files
committed
fix: Remove redundant length validation check, update pre-commit and run
1 parent 3a7ab05 commit 2ace109

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.99.4
3+
rev: v1.100.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_wrapper_module_for_each
@@ -24,7 +24,7 @@ repos:
2424
- '--args=--only=terraform_workspace_remote'
2525
- id: terraform_validate
2626
- repo: https://github.com/pre-commit/pre-commit-hooks
27-
rev: v5.0.0
27+
rev: v6.0.0
2828
hooks:
2929
- id: check-merge-conflict
3030
- id: end-of-file-fixer

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ No modules.
208208
| <a name="input_ebs_options"></a> [ebs\_options](#input\_ebs\_options) | Configuration block for EBS related options, may be required based on chosen [instance size](https://aws.amazon.com/elasticsearch-service/pricing/) | `any` | <pre>{<br/> "ebs_enabled": true,<br/> "volume_size": 64,<br/> "volume_type": "gp3"<br/>}</pre> | no |
209209
| <a name="input_enable_access_policy"></a> [enable\_access\_policy](#input\_enable\_access\_policy) | Determines whether an access policy will be applied to the domain | `bool` | `true` | no |
210210
| <a name="input_encrypt_at_rest"></a> [encrypt\_at\_rest](#input\_encrypt\_at\_rest) | Configuration block for encrypting at rest | `any` | <pre>{<br/> "enabled": true<br/>}</pre> | no |
211-
| <a name="input_engine_version"></a> [engine\_version](#input\_engine\_version) | Version of the OpenSearch engine to use | `string` | `null` | no |
211+
| <a name="input_engine_version"></a> [engine\_version](#input\_engine\_version) | Version of the OpenSearch engine to use. Must follow format 'OpenSearch\_X.Y' (e.g., 'OpenSearch\_2.11') | `string` | `null` | no |
212212
| <a name="input_ip_address_type"></a> [ip\_address\_type](#input\_ip\_address\_type) | The IP address type for the endpoint. Valid values are ipv4 and dualstack | `string` | `null` | no |
213213
| <a name="input_log_publishing_options"></a> [log\_publishing\_options](#input\_log\_publishing\_options) | Configuration block for publishing slow and application logs to CloudWatch Logs. This block can be declared multiple times, for each log\_type, within the same resource | `any` | <pre>[<br/> {<br/> "log_type": "INDEX_SLOW_LOGS"<br/> },<br/> {<br/> "log_type": "SEARCH_SLOW_LOGS"<br/> }<br/>]</pre> | no |
214214
| <a name="input_node_to_node_encryption"></a> [node\_to\_node\_encryption](#input\_node\_to\_node\_encryption) | Configuration block for node-to-node encryption options | `any` | <pre>{<br/> "enabled": true<br/>}</pre> | no |

variables.tf

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,18 @@ variable "engine_version" {
9191
default = null
9292

9393
validation {
94-
condition = var.engine_version == null || can(regex("^(Elasticsearch_[0-9]{1}\\.[0-9]{1,2}|OpenSearch_[0-9]{1,2}\\.[0-9]{1,2})$", var.engine_version))
94+
condition = var.engine_version == null || can(regex("^(Elasticsearch_[0-9]{1}\\.[0-9]{1,2}|OpenSearch_[0-9]{1,2}\\.[0-9]{1,2})$", var.engine_version))
9595
error_message = <<-EOT
9696
The engine_version must be in the format:
9797
- 'OpenSearch_X.Y' where X is 1-2 digits and Y is 1-2 digits (e.g., 'OpenSearch_2.11', 'OpenSearch_1.3')
9898
- 'Elasticsearch_X.Y' where X is 1 digit and Y is 1-2 digits (e.g., 'Elasticsearch_7.10')
99-
99+
100100
Your provided value appears to be a software service version (with release dates/patches).
101101
Please use only the engine version format. Common valid versions include:
102102
- OpenSearch_1.0, OpenSearch_1.1, OpenSearch_1.2, OpenSearch_1.3
103103
- OpenSearch_2.0, OpenSearch_2.3, OpenSearch_2.5, OpenSearch_2.7, OpenSearch_2.9, OpenSearch_2.11
104104
EOT
105105
}
106-
107-
validation {
108-
condition = var.engine_version == null || length(var.engine_version) <= 18
109-
error_message = "The engine_version must be 18 characters or less. Software service versions with dates/patches are not valid here."
110-
}
111106
}
112107

113108
variable "ip_address_type" {

0 commit comments

Comments
 (0)