Skip to content

Commit 9d15314

Browse files
authored
Merge pull request #22 from fsperling/master
fix deprecated syntax warnings
2 parents 2328d90 + 30835fb commit 9d15314

File tree

2 files changed

+54
-54
lines changed

2 files changed

+54
-54
lines changed

main.tf

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
resource "aws_security_group" "elasticsearch" {
2-
name = "${var.name}"
2+
name = var.name
33
description = "Security Group to allow traffic to ElasticSearch"
44

5-
vpc_id = "${var.vpc_id}"
5+
vpc_id = var.vpc_id
66
}
77

88
resource "aws_security_group_rule" "secure_cidrs" {
9-
count = "${length(var.ingress_allow_cidr_blocks) > 0 ? 1 : 0}"
9+
count = length(var.ingress_allow_cidr_blocks) > 0 ? 1 : 0
1010

1111
type = "ingress"
1212
from_port = 443
1313
to_port = 443
1414
protocol = "TCP"
1515
cidr_blocks = var.ingress_allow_cidr_blocks
1616

17-
security_group_id = "${aws_security_group.elasticsearch.id}"
17+
security_group_id = aws_security_group.elasticsearch.id
1818
}
1919

2020
resource "aws_security_group_rule" "secure_sgs" {
21-
count = "${length(var.ingress_allow_security_groups)}"
21+
count = length(var.ingress_allow_security_groups)
2222

2323
type = "ingress"
2424
from_port = 443
2525
to_port = 443
2626
protocol = "tcp"
27-
source_security_group_id = "${element(var.ingress_allow_security_groups, count.index)}"
27+
source_security_group_id = element(var.ingress_allow_security_groups, count.index)
2828

29-
security_group_id = "${aws_security_group.elasticsearch.id}"
29+
security_group_id = aws_security_group.elasticsearch.id
3030
}
3131

3232
resource "aws_security_group_rule" "egress_all" {
@@ -36,7 +36,7 @@ resource "aws_security_group_rule" "egress_all" {
3636
protocol = "-1"
3737
cidr_blocks = ["0.0.0.0/0"]
3838

39-
security_group_id = "${aws_security_group.elasticsearch.id}"
39+
security_group_id = aws_security_group.elasticsearch.id
4040
}
4141

4242
# https://github.com/terraform-providers/terraform-provider-aws/issues/5218
@@ -47,62 +47,62 @@ resource "aws_iam_service_linked_role" "default" {
4747
}
4848

4949
resource "aws_elasticsearch_domain" "es" {
50-
domain_name = "${var.name}"
51-
elasticsearch_version = "${var.elasticsearch_version}"
50+
domain_name = var.name
51+
elasticsearch_version = var.elasticsearch_version
5252

5353
encrypt_at_rest {
54-
enabled = "${var.encryption_enabled}"
55-
kms_key_id = "${var.encryption_kms_key_id}"
54+
enabled = var.encryption_enabled
55+
kms_key_id = var.encryption_kms_key_id
5656
}
5757

5858
cluster_config {
59-
instance_type = "${var.itype}"
60-
instance_count = "${var.icount}"
61-
dedicated_master_enabled = "${var.dedicated_master}"
62-
dedicated_master_type = "${var.mtype}"
63-
dedicated_master_count = "${var.mcount}"
64-
zone_awareness_enabled = "${var.zone_awareness}"
59+
instance_type = var.itype
60+
instance_count = var.icount
61+
dedicated_master_enabled = var.dedicated_master
62+
dedicated_master_type = var.mtype
63+
dedicated_master_count = var.mcount
64+
zone_awareness_enabled = var.zone_awareness
6565
}
6666

67-
access_policies = "${var.access_policies}"
67+
access_policies = var.access_policies
6868

6969
vpc_options {
70-
security_group_ids = ["${aws_security_group.elasticsearch.id}"]
70+
security_group_ids = [aws_security_group.elasticsearch.id]
7171
subnet_ids = var.subnet_ids
7272
}
7373

7474
advanced_options = {
75-
"rest.action.multi.allow_explicit_index" = "${var.rest_action_multi_allow_explicit_index}"
76-
"indices.fielddata.cache.size" = "${var.indices_fielddata_cache_size}"
77-
"indices.query.bool.max_clause_count" = "${var.indices_query_bool_max_clause_count}"
75+
"rest.action.multi.allow_explicit_index" = var.rest_action_multi_allow_explicit_index
76+
"indices.fielddata.cache.size" = var.indices_fielddata_cache_size
77+
"indices.query.bool.max_clause_count" = var.indices_query_bool_max_clause_count
7878
}
7979

8080
ebs_options {
8181
ebs_enabled = true
82-
volume_type = "${var.volume_type}"
83-
volume_size = "${var.volume_size}"
82+
volume_type = var.volume_type
83+
volume_size = var.volume_size
8484
}
8585

8686
snapshot_options {
87-
automated_snapshot_start_hour = "${var.snapshot_start}"
87+
automated_snapshot_start_hour = var.snapshot_start
8888
}
8989

9090
tags = {
91-
Domain = "${var.name}"
91+
Domain = var.name
9292
}
9393

9494
depends_on = [
95-
"aws_iam_service_linked_role.default",
95+
aws_iam_service_linked_role.default,
9696
]
9797
}
9898

9999
# Add ALB record on DNS
100100
resource "aws_route53_record" "main" {
101-
count = "${length(var.zone_id) > 0 ? 1 : 0}"
102-
zone_id = "${var.zone_id}"
103-
name = "${var.name}"
101+
count = length(var.zone_id) > 0 ? 1 : 0
102+
zone_id = var.zone_id
103+
name = var.name
104104
type = "CNAME"
105105
ttl = "300"
106106

107-
records = ["${aws_elasticsearch_domain.es.endpoint}"]
107+
records = [aws_elasticsearch_domain.es.endpoint]
108108
}

variables.tf

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// Required
22
variable "name" {
33
description = "Elastic Search Service cluster name."
4-
type = "string"
4+
type = string
55
}
66

77
variable "subnet_ids" {
88
description = "List of VPC Subnet IDs for the Elastic Search Service EndPoints will be created."
9-
type = "list"
9+
type = list
1010
}
1111

1212
variable "vpc_id" {
1313
description = "Vpc id where the Elastic Search Service cluster will be launched."
14-
type = "string"
14+
type = string
1515
}
1616

1717
// Optional
@@ -23,113 +23,113 @@ variable "create_iam_service_linked_role" {
2323
variable "zone_id" {
2424
default = ""
2525
description = "Route 53 zone id where the DNS record will be created."
26-
type = "string"
26+
type = string
2727
}
2828

2929
variable "access_policies" {
3030
default = ""
3131
description = "IAM policy document specifying the access policies for the domain."
32-
type = "string"
32+
type = string
3333
}
3434

3535
variable "dedicated_master" {
3636
default = false
3737
description = "Indicates whether our cluster have dedicated master nodes enabled."
38-
type = "string"
38+
type = string
3939
}
4040

4141
variable "encryption_enabled" {
4242
default = "false"
4343
description = "Enable encription in Elastic Search."
44-
type = "string"
44+
type = string
4545
}
4646

4747
variable "encryption_kms_key_id" {
4848
default = ""
4949
description = "Enable encription in Elastic Search."
50-
type = "string"
50+
type = string
5151
}
5252

5353
variable "elasticsearch_version" {
5454
default = "5.5"
5555
description = "Elastic Search Service cluster version number."
56-
type = "string"
56+
type = string
5757
}
5858

5959
variable "icount" {
6060
default = 1
6161
description = "Elastic Search Service cluster Ec2 instance number."
62-
type = "string"
62+
type = string
6363
}
6464

6565
variable "indices_fielddata_cache_size" {
6666
default = ""
6767
description = "Percentage of Java heap space allocated to field data."
68-
type = "string"
68+
type = string
6969
}
7070

7171
variable "indices_query_bool_max_clause_count" {
7272
default = 1024
7373
description = "Maximum number of clauses allowed in a Lucene boolean query."
74-
type = "string"
74+
type = string
7575
}
7676

7777
variable "ingress_allow_cidr_blocks" {
7878
default = []
7979
description = "Specifies the ingress CIDR blocks allowed."
80-
type = "list"
80+
type = list
8181
}
8282

8383
variable "ingress_allow_security_groups" {
8484
default = []
8585
description = "Specifies the ingress security groups allowed."
86-
type = "list"
86+
type = list
8787
}
8888

8989
variable "itype" {
9090
default = "m4.large.elasticsearch"
9191
description = "Elastic Search Service cluster Ec2 instance type."
92-
type = "string"
92+
type = string
9393
}
9494

9595
variable "mcount" {
9696
default = 0
9797
description = "Elastic Search Service cluster dedicated master Ec2 instance number."
98-
type = "string"
98+
type = string
9999
}
100100

101101
variable "mtype" {
102102
default = ""
103103
description = "Elastic Search Service cluster dedicated master Ec2 instance type."
104-
type = "string"
104+
type = string
105105
}
106106

107107
variable "zone_awareness" {
108108
default = false
109109
description = "Indicates whether zone awareness is enabled."
110-
type = "string"
110+
type = string
111111
}
112112

113113
variable "rest_action_multi_allow_explicit_index" {
114114
default = "true"
115115
description = "Specifies whether explicit references to indices are allowed inside the body of HTTP requests."
116-
type = "string"
116+
type = string
117117
}
118118

119119
variable "snapshot_start" {
120120
default = 0
121121
description = "Elastic Search Service maintenance/snapshot start time."
122-
type = "string"
122+
type = string
123123
}
124124

125125
variable "volume_size" {
126126
default = "35"
127127
description = "Default size of the EBS volumes."
128-
type = "string"
128+
type = string
129129
}
130130

131131
variable "volume_type" {
132132
default = "gp2"
133133
description = "Default type of the EBS volumes."
134-
type = "string"
134+
type = string
135135
}

0 commit comments

Comments
 (0)