Skip to content

Commit c5bb3e8

Browse files
authored
Merge pull request #39 from lgallard/feature/config-objects-values
Update config variables to support objects instead of maps values
2 parents c404840 + 13b8f2e commit c5bb3e8

File tree

12 files changed

+105
-83
lines changed

12 files changed

+105
-83
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 0.10.0 (April 30, 2021)
2+
3+
ENHANCEMENTS:
4+
5+
* Update config variables to support objects instead of maps values
6+
* Update README & examples
7+
8+
FIXES:
9+
10+
* Remove `availability_zone_count` constraint
11+
112
## 0.9.1 (April 22, 2021)
213

314
ENHANCEMENTS:

README.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ module "aws_es" {
2222
elasticsearch_version = "7.1"
2323
2424
cluster_config = {
25-
dedicated_master_enabled = "true"
26-
instance_count = "3"
25+
dedicated_master_enabled = true
26+
instance_count = 3
2727
instance_type = "r5.large.elasticsearch"
28-
zone_awareness_enabled = "true"
29-
availability_zone_count = "3"
28+
zone_awareness_enabled = true
29+
availability_zone_count = 3
3030
}
3131
3232
ebs_options = {
@@ -35,17 +35,17 @@ module "aws_es" {
3535
}
3636
3737
encrypt_at_rest = {
38-
enabled = "true"
38+
enabled = true
3939
kms_key_id = "arn:aws:kms:us-east-1:123456789101:key/cccc103b-4ba3-5993-6fc7-b7e538b25fd8"
4040
}
4141
4242
log_publishing_options = {
43-
enabled = "true"
43+
enabled = true
4444
log_type = "INDEX_SLOW_LOGS"
4545
}
4646
4747
advanced_options = {
48-
"rest.action.multi.allow_explicit_index" = "true"
48+
"rest.action.multi.allow_explicit_index" = true
4949
}
5050
5151
domain_endpoint_options = {
@@ -55,8 +55,8 @@ module "aws_es" {
5555
custom_endpoint_certificate_arn = "arn:aws:acm:us-east-1:123456789101:certificate/abcd1234-ef11-abcd-1234-abcd1234efef"
5656
}
5757
58-
node_to_node_encryption_enabled = "true"
59-
snapshot_options_automated_snapshot_start_hour = "23"
58+
node_to_node_encryption_enabled = true
59+
snapshot_options_automated_snapshot_start_hour = 23
6060
6161
tags = {
6262
Owner = "sysops"
@@ -76,13 +76,13 @@ module "aws_es" {
7676
elasticsearch_version = "7.1"
7777
7878
cluster_config_dedicated_master_enabled = true
79-
cluster_config_instance_count = "3"
79+
cluster_config_instance_count = 3
8080
cluster_config_instance_type = "r5.large.elasticsearch"
8181
cluster_config_zone_awareness_enabled = "true"
82-
cluster_config_availability_zone_count = "3"
82+
cluster_config_availability_zone_count = 3
8383
8484
ebs_options_ebs_enabled = true
85-
ebs_options_volume_size = "25"
85+
ebs_options_volume_size = 25
8686
8787
encrypt_at_rest_enabled = true
8888
encrypt_at_rest_kms_key_id = "alias/aws/es"
@@ -91,11 +91,11 @@ module "aws_es" {
9191
log_publishing_options_log_type = "INDEX_SLOW_LOGS"
9292
9393
advanced_options = {
94-
"rest.action.multi.allow_explicit_index" = "true"
94+
"rest.action.multi.allow_explicit_index" = true
9595
}
9696
97-
node_to_node_encryption_enabled = "true"
98-
snapshot_options_automated_snapshot_start_hour = "23"
97+
node_to_node_encryption_enabled = true
98+
snapshot_options_automated_snapshot_start_hour = 23
9999
100100
tags = {
101101
Owner = "sysops"
@@ -143,7 +143,7 @@ No modules.
143143
| <a name="input_advanced_security_options_master_user_arn"></a> [advanced\_security\_options\_master\_user\_arn](#input\_advanced\_security\_options\_master\_user\_arn) | ARN for the master user. Only specify if `internal_user_database_enabled` is not set or set to `false`) | `string` | `null` | no |
144144
| <a name="input_advanced_security_options_master_user_password"></a> [advanced\_security\_options\_master\_user\_password](#input\_advanced\_security\_options\_master\_user\_password) | The master user's password, which is stored in the Amazon Elasticsearch Service domain's internal database. Only specify if `internal_user_database_enabled` is set to `true`. | `string` | `null` | no |
145145
| <a name="input_advanced_security_options_master_user_username"></a> [advanced\_security\_options\_master\_user\_username](#input\_advanced\_security\_options\_master\_user\_username) | The master user's username, which is stored in the Amazon Elasticsearch Service domain's internal database. Only specify if `internal_user_database_enabled` is set to `true`. | `string` | `null` | no |
146-
| <a name="input_cluster_config"></a> [cluster\_config](#input\_cluster\_config) | Cluster configuration of the domain | `map` | `{}` | no |
146+
| <a name="input_cluster_config"></a> [cluster\_config](#input\_cluster\_config) | Cluster configuration of the domain | `any` | `{}` | no |
147147
| <a name="input_cluster_config_availability_zone_count"></a> [cluster\_config\_availability\_zone\_count](#input\_cluster\_config\_availability\_zone\_count) | Number of Availability Zones for the domain to use with | `number` | `3` | no |
148148
| <a name="input_cluster_config_dedicated_master_count"></a> [cluster\_config\_dedicated\_master\_count](#input\_cluster\_config\_dedicated\_master\_count) | Number of dedicated master nodes in the cluster | `number` | `3` | no |
149149
| <a name="input_cluster_config_dedicated_master_enabled"></a> [cluster\_config\_dedicated\_master\_enabled](#input\_cluster\_config\_dedicated\_master\_enabled) | Indicates whether dedicated master nodes are enabled for the cluster | `bool` | `true` | no |
@@ -154,7 +154,7 @@ No modules.
154154
| <a name="input_cluster_config_warm_enabled"></a> [cluster\_config\_warm\_enabled](#input\_cluster\_config\_warm\_enabled) | Indicates whether to enable warm storage | `bool` | `false` | no |
155155
| <a name="input_cluster_config_warm_type"></a> [cluster\_config\_warm\_type](#input\_cluster\_config\_warm\_type) | The instance type for the Elasticsearch cluster's warm nodes | `string` | `null` | no |
156156
| <a name="input_cluster_config_zone_awareness_enabled"></a> [cluster\_config\_zone\_awareness\_enabled](#input\_cluster\_config\_zone\_awareness\_enabled) | Indicates whether zone awareness is enabled. To enable awareness with three Availability Zones | `bool` | `false` | no |
157-
| <a name="input_cognito_options"></a> [cognito\_options](#input\_cognito\_options) | Options for Amazon Cognito Authentication for Kibana | `map` | `{}` | no |
157+
| <a name="input_cognito_options"></a> [cognito\_options](#input\_cognito\_options) | Options for Amazon Cognito Authentication for Kibana | `any` | `{}` | no |
158158
| <a name="input_cognito_options_enabled"></a> [cognito\_options\_enabled](#input\_cognito\_options\_enabled) | Specifies whether Amazon Cognito authentication with Kibana is enabled or not | `bool` | `false` | no |
159159
| <a name="input_cognito_options_identity_pool_id"></a> [cognito\_options\_identity\_pool\_id](#input\_cognito\_options\_identity\_pool\_id) | ID of the Cognito Identity Pool to use | `string` | `""` | no |
160160
| <a name="input_cognito_options_role_arn"></a> [cognito\_options\_role\_arn](#input\_cognito\_options\_role\_arn) | ARN of the IAM role that has the AmazonESCognitoAccess policy attached | `string` | `""` | no |
@@ -168,30 +168,30 @@ No modules.
168168
| <a name="input_domain_endpoint_options_tls_security_policy"></a> [domain\_endpoint\_options\_tls\_security\_policy](#input\_domain\_endpoint\_options\_tls\_security\_policy) | The name of the TLS security policy that needs to be applied to the HTTPS endpoint. Valid values: `Policy-Min-TLS-1-0-2019-07` and `Policy-Min-TLS-1-2-2019-07` | `string` | `"Policy-Min-TLS-1-2-2019-07"` | no |
169169
| <a name="input_domain_name"></a> [domain\_name](#input\_domain\_name) | Name of the domain | `string` | n/a | yes |
170170
| <a name="input_ebs_enabled"></a> [ebs\_enabled](#input\_ebs\_enabled) | Whether EBS volumes are attached to data nodes in the domain | `bool` | `true` | no |
171-
| <a name="input_ebs_options"></a> [ebs\_options](#input\_ebs\_options) | EBS related options, may be required based on chosen instance size | `map` | `{}` | no |
171+
| <a name="input_ebs_options"></a> [ebs\_options](#input\_ebs\_options) | EBS related options, may be required based on chosen instance size | `any` | `{}` | no |
172172
| <a name="input_ebs_options_iops"></a> [ebs\_options\_iops](#input\_ebs\_options\_iops) | The baseline input/output (I/O) performance of EBS volumes attached to data nodes. Applicable only for the Provisioned IOPS EBS volume type | `number` | `0` | no |
173173
| <a name="input_ebs_options_volume_size"></a> [ebs\_options\_volume\_size](#input\_ebs\_options\_volume\_size) | The size of EBS volumes attached to data nodes (in GB). Required if ebs\_enabled is set to true | `number` | `10` | no |
174174
| <a name="input_ebs_options_volume_type"></a> [ebs\_options\_volume\_type](#input\_ebs\_options\_volume\_type) | The type of EBS volumes attached to data nodes | `string` | `"gp2"` | no |
175175
| <a name="input_elasticsearch_version"></a> [elasticsearch\_version](#input\_elasticsearch\_version) | The version of Elasticsearch to deploy. | `string` | `"7.1"` | no |
176176
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Change to false to avoid deploying any AWS ElasticSearch resources | `bool` | `true` | no |
177-
| <a name="input_encrypt_at_rest"></a> [encrypt\_at\_rest](#input\_encrypt\_at\_rest) | Encrypt at rest options. Only available for certain instance types | `map` | `{}` | no |
177+
| <a name="input_encrypt_at_rest"></a> [encrypt\_at\_rest](#input\_encrypt\_at\_rest) | Encrypt at rest options. Only available for certain instance types | `any` | `{}` | no |
178178
| <a name="input_encrypt_at_rest_enabled"></a> [encrypt\_at\_rest\_enabled](#input\_encrypt\_at\_rest\_enabled) | Whether to enable encryption at rest | `bool` | `true` | no |
179179
| <a name="input_encrypt_at_rest_kms_key_id"></a> [encrypt\_at\_rest\_kms\_key\_id](#input\_encrypt\_at\_rest\_kms\_key\_id) | The KMS key id to encrypt the Elasticsearch domain with. If not specified then it defaults to using the aws/es service KMS key | `string` | `"alias/aws/es"` | no |
180-
| <a name="input_log_publishing_options"></a> [log\_publishing\_options](#input\_log\_publishing\_options) | Options for publishing slow logs to CloudWatch Logs | `map` | `{}` | no |
180+
| <a name="input_log_publishing_options"></a> [log\_publishing\_options](#input\_log\_publishing\_options) | Options for publishing slow logs to CloudWatch Logs | `any` | `{}` | no |
181181
| <a name="input_log_publishing_options_cloudwatch_log_group_arn"></a> [log\_publishing\_options\_cloudwatch\_log\_group\_arn](#input\_log\_publishing\_options\_cloudwatch\_log\_group\_arn) | iARN of the Cloudwatch log group to which log needs to be published | `string` | `""` | no |
182182
| <a name="input_log_publishing_options_enabled"></a> [log\_publishing\_options\_enabled](#input\_log\_publishing\_options\_enabled) | Specifies whether given log publishing option is enabled or not | `bool` | `true` | no |
183183
| <a name="input_log_publishing_options_log_type"></a> [log\_publishing\_options\_log\_type](#input\_log\_publishing\_options\_log\_type) | A type of Elasticsearch log. Valid values: INDEX\_SLOW\_LOGS, SEARCH\_SLOW\_LOGS, ES\_APPLICATION\_LOGS | `string` | `"INDEX_SLOW_LOGS"` | no |
184184
| <a name="input_log_publishing_options_retention"></a> [log\_publishing\_options\_retention](#input\_log\_publishing\_options\_retention) | Retention in days for the created Cloudwatch log group | `number` | `90` | no |
185-
| <a name="input_node_to_node_encryption"></a> [node\_to\_node\_encryption](#input\_node\_to\_node\_encryption) | Node-to-node encryption options | `map` | `{}` | no |
185+
| <a name="input_node_to_node_encryption"></a> [node\_to\_node\_encryption](#input\_node\_to\_node\_encryption) | Node-to-node encryption options | `any` | `{}` | no |
186186
| <a name="input_node_to_node_encryption_enabled"></a> [node\_to\_node\_encryption\_enabled](#input\_node\_to\_node\_encryption\_enabled) | Whether to enable node-to-node encryption | `bool` | `true` | no |
187-
| <a name="input_snapshot_options"></a> [snapshot\_options](#input\_snapshot\_options) | Snapshot related options | `map` | `{}` | no |
187+
| <a name="input_snapshot_options"></a> [snapshot\_options](#input\_snapshot\_options) | Snapshot related options | `any` | `{}` | no |
188188
| <a name="input_snapshot_options_automated_snapshot_start_hour"></a> [snapshot\_options\_automated\_snapshot\_start\_hour](#input\_snapshot\_options\_automated\_snapshot\_start\_hour) | Hour during which the service takes an automated daily snapshot of the indices in the domain | `number` | `0` | no |
189-
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to the resource | `map` | `{}` | no |
190-
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Timeouts map. | `map` | `{}` | no |
189+
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to the resource | `map(any)` | `{}` | no |
190+
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Timeouts map. | `map(any)` | `{}` | no |
191191
| <a name="input_timeouts_update"></a> [timeouts\_update](#input\_timeouts\_update) | How long to wait for updates. | `string` | `null` | no |
192-
| <a name="input_vpc_options"></a> [vpc\_options](#input\_vpc\_options) | VPC related options, see below. Adding or removing this configuration forces a new resource | `map` | `{}` | no |
193-
| <a name="input_vpc_options_security_group_ids"></a> [vpc\_options\_security\_group\_ids](#input\_vpc\_options\_security\_group\_ids) | List of VPC Security Group IDs to be applied to the Elasticsearch domain endpoints. If omitted, the default Security Group for the VPC will be used | `list` | `[]` | no |
194-
| <a name="input_vpc_options_subnet_ids"></a> [vpc\_options\_subnet\_ids](#input\_vpc\_options\_subnet\_ids) | List of VPC Subnet IDs for the Elasticsearch domain endpoints to be created in | `list` | `[]` | no |
192+
| <a name="input_vpc_options"></a> [vpc\_options](#input\_vpc\_options) | VPC related options, see below. Adding or removing this configuration forces a new resource | `any` | `{}` | no |
193+
| <a name="input_vpc_options_security_group_ids"></a> [vpc\_options\_security\_group\_ids](#input\_vpc\_options\_security\_group\_ids) | List of VPC Security Group IDs to be applied to the Elasticsearch domain endpoints. If omitted, the default Security Group for the VPC will be used | `list(any)` | `[]` | no |
194+
| <a name="input_vpc_options_subnet_ids"></a> [vpc\_options\_subnet\_ids](#input\_vpc\_options\_subnet\_ids) | List of VPC Subnet IDs for the Elasticsearch domain endpoints to be created in | `list(any)` | `[]` | no |
195195

196196
## Outputs
197197

examples/advanced_security_options_master_user_arn/main.tf

+11-12
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ module "aws_es" {
66
elasticsearch_version = var.es_version
77

88
cluster_config = {
9-
dedicated_master_enabled = "true"
10-
instance_count = "3"
9+
dedicated_master_enabled = true
10+
instance_count = 3
1111
instance_type = "r5.large.elasticsearch"
12-
zone_awareness_enabled = "true"
13-
availability_zone_count = "3"
12+
zone_awareness_enabled = true
13+
availability_zone_count = 3
1414
}
1515

1616
advanced_security_options = {
@@ -28,22 +28,21 @@ module "aws_es" {
2828
}
2929

3030
ebs_options = {
31-
ebs_enabled = "true"
32-
volume_size = "25"
31+
ebs_enabled = true
32+
volume_size = 25
3333
}
3434

3535
encrypt_at_rest = {
36-
enabled = "true"
36+
enabled = true
3737
kms_key_id = "arn:aws:kms:us-east-1:123456789101:key/cccc103b-4ba3-5993-6fc7-b7e538b25fd8"
3838
}
3939

40-
4140
log_publishing_options = {
42-
enabled = "true"
41+
enabled = true
4342
}
4443

4544
advanced_options = {
46-
"rest.action.multi.allow_explicit_index" = "true"
45+
"rest.action.multi.allow_explicit_index" = true
4746
}
4847

4948
access_policies = templatefile("${path.module}/whitelits.tpl", {
@@ -53,8 +52,8 @@ module "aws_es" {
5352
whitelist = jsonencode(var.whitelist)
5453
})
5554

56-
node_to_node_encryption_enabled = "true"
57-
snapshot_options_automated_snapshot_start_hour = "23"
55+
node_to_node_encryption_enabled = true
56+
snapshot_options_automated_snapshot_start_hour = 23
5857

5958
#timeouts_update = "90m"
6059

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

22
terraform {
33
required_version = ">= 0.12"
4+
required_providers {
5+
aws = ">= 3.35.0"
6+
}
47
}

examples/advanced_security_options_master_user_name_pasword/main.tf

+11-12
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ module "aws_es" {
66
elasticsearch_version = var.es_version
77

88
cluster_config = {
9-
dedicated_master_enabled = "true"
10-
instance_count = "3"
9+
dedicated_master_enabled = true
10+
instance_count = 3
1111
instance_type = "r5.large.elasticsearch"
12-
zone_awareness_enabled = "true"
13-
availability_zone_count = "3"
12+
zone_awareness_enabled = true
13+
availability_zone_count = 3
1414
}
1515

1616
advanced_security_options = {
@@ -30,22 +30,21 @@ module "aws_es" {
3030
}
3131

3232
ebs_options = {
33-
ebs_enabled = "true"
34-
volume_size = "25"
33+
ebs_enabled = true
34+
volume_size = 25
3535
}
3636

3737
encrypt_at_rest = {
38-
enabled = "true"
38+
enabled = true
3939
kms_key_id = "arn:aws:kms:us-east-1:123456789101:key/cccc103b-4ba3-5993-6fc7-b7e538b25fd8"
4040
}
4141

42-
4342
log_publishing_options = {
44-
enabled = "true"
43+
enabled = true
4544
}
4645

4746
advanced_options = {
48-
"rest.action.multi.allow_explicit_index" = "true"
47+
"rest.action.multi.allow_explicit_index" = true
4948
}
5049

5150
access_policies = templatefile("${path.module}/whitelits.tpl", {
@@ -55,8 +54,8 @@ module "aws_es" {
5554
whitelist = jsonencode(var.whitelist)
5655
})
5756

58-
node_to_node_encryption_enabled = "true"
59-
snapshot_options_automated_snapshot_start_hour = "23"
57+
node_to_node_encryption_enabled = true
58+
snapshot_options_automated_snapshot_start_hour = 23
6059

6160
#timeouts_update = "90m"
6261

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

22
terraform {
33
required_version = ">= 0.12"
4+
required_providers {
5+
aws = ">= 3.35.0"
6+
}
47
}

examples/public/main.tf

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ module "aws_es" {
66
elasticsearch_version = var.es_version
77

88
cluster_config = {
9-
dedicated_master_enabled = "true"
10-
instance_count = "3"
9+
dedicated_master_enabled = true
10+
instance_count = 3
1111
instance_type = "r5.large.elasticsearch"
12-
zone_awareness_enabled = "true"
13-
availability_zone_count = "3"
12+
zone_awareness_enabled = true
13+
availability_zone_count = 3
1414
}
1515

1616
ebs_options = {
17-
ebs_enabled = "true"
18-
volume_size = "25"
17+
ebs_enabled = true
18+
volume_size = 25
1919
}
2020

2121
encrypt_at_rest = {
22-
enabled = "true"
22+
enabled = true
2323
kms_key_id = "arn:aws:kms:us-east-1:123456789101:key/cccc103b-4ba3-5993-6fc7-b7e538b25fd8"
2424
}
2525

2626
log_publishing_options = {
27-
enabled = "true"
27+
enabled = true
2828
}
2929

3030
advanced_options = {
31-
"rest.action.multi.allow_explicit_index" = "true"
31+
"rest.action.multi.allow_explicit_index" = true
3232
}
3333

3434
access_policies = templatefile("${path.module}/whitelits.tpl", {
@@ -38,8 +38,8 @@ module "aws_es" {
3838
whitelist = jsonencode(var.whitelist)
3939
})
4040

41-
node_to_node_encryption_enabled = "true"
42-
snapshot_options_automated_snapshot_start_hour = "23"
41+
node_to_node_encryption_enabled = true
42+
snapshot_options_automated_snapshot_start_hour = 23
4343

4444
timeouts_update = "60m"
4545

examples/public/versions.tf

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

22
terraform {
33
required_version = ">= 0.12"
4+
required_providers {
5+
aws = ">= 3.35.0"
6+
}
47
}

examples/vpc/main.tf

+7-8
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ module "aws_es" {
66
elasticsearch_version = var.es_version
77

88
cluster_config = {
9-
dedicated_master_enabled = "true"
10-
instance_count = "3"
9+
dedicated_master_enabled = true
10+
instance_count = 3
1111
instance_type = "r5.large.elasticsearch"
12-
zone_awareness_enabled = "true"
13-
availability_zone_count = "3"
12+
zone_awareness_enabled = true
13+
availability_zone_count = 3
1414
}
1515

1616
ebs_options = {
17-
ebs_enabled = "true"
18-
volume_size = "25"
17+
ebs_enabled = true
18+
volume_size = 25
1919
}
2020

2121
encrypt_at_rest = {
22-
enabled = "true"
22+
enabled = true
2323
kms_key_id = "arn:aws:kms:us-east-1:123456789101:key/cccc103b-4ba3-5993-6fc7-b7e538b25fd8"
2424
}
2525

@@ -43,5 +43,4 @@ module "aws_es" {
4343
Owner = "sysops"
4444
env = "dev"
4545
}
46-
4746
}

examples/vpc/versions.tf

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

22
terraform {
33
required_version = ">= 0.12"
4+
required_providers {
5+
aws = ">= 3.35.0"
6+
}
7+
48
}

main.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ resource "aws_elasticsearch_domain" "es_domain" {
8585

8686
dynamic "zone_awareness_config" {
8787
# cluster_availability_zone_count valid values: 2 or 3.
88-
for_each = lookup(cluster_config.value, "zone_awareness_enabled", false) == false || ! contains(["2", "3"], lookup(cluster_config.value, "availability_zone_count", "1")) ? [] : [1]
88+
for_each = lookup(cluster_config.value, "zone_awareness_enabled", false) ? [1] : []
8989
content {
9090
availability_zone_count = lookup(cluster_config.value, "availability_zone_count")
91+
9192
}
9293
}
9394
}

0 commit comments

Comments
 (0)