File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -125,9 +125,21 @@ resource "aws_elasticsearch_domain" "this" {
125
125
automated_snapshot_start_hour = 1
126
126
}
127
127
128
+ log_publishing_options {
129
+ log_type = " INDEX_SLOW_LOGS"
130
+ cloudwatch_log_group_arn = " ${ aws_cloudwatch_log_group . this . arn } "
131
+ enabled = " ${ var . enable_logs } "
132
+ }
133
+
128
134
tags = " ${ merge (var. tags , map (" Name" , var. name ))} "
129
135
}
130
136
137
+ resource "aws_cloudwatch_log_group" "this" {
138
+ count = " ${ var . enable_logs ? 1 : 0 } "
139
+ name = " ${ local . id } -ElasticSearch"
140
+ retention_in_days = 0
141
+ tags = " ${ merge (var. tags , map (" Name" , var. name ))} "
142
+ }
131
143
132
144
resource "aws_elasticsearch_domain_policy" "this" {
133
145
domain_name = " ${ aws_elasticsearch_domain . this . domain_name } "
Original file line number Diff line number Diff line change @@ -59,3 +59,8 @@ variable "instances" {
59
59
description = " Instance count"
60
60
default = 1
61
61
}
62
+
63
+ variable "enable_logs" {
64
+ description = " Enalbe CloudWatch Logs"
65
+ default = false
66
+ }
You can’t perform that action at this time.
0 commit comments