Skip to content

Commit 2f8f15e

Browse files
authored
Merge pull request #28 from octobot-dev/master
Add retention configuration variable for Cloudwatch log group
2 parents 2e3a6a3 + c7e9a1f commit 2f8f15e

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ module "aws_es" {
148148
| log\_publishing\_options\_cloudwatch\_log\_group\_arn | iARN of the Cloudwatch log group to which log needs to be published | `string` | `""` | no |
149149
| log\_publishing\_options\_enabled | Specifies whether given log publishing option is enabled or not | `bool` | `true` | no |
150150
| 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 |
151+
| log\_publishing\_options\_retention | Retention in days for the created Cloudwatch log group | `number` | `90` | no |
151152
| node\_to\_node\_encryption | Node-to-node encryption options | `map` | `{}` | no |
152153
| node\_to\_node\_encryption\_enabled | Whether to enable node-to-node encryption | `bool` | `true` | no |
153154
| snapshot\_options | Snapshot related options | `map` | `{}` | no |

iam.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
resource "aws_cloudwatch_log_group" "es_cloudwatch_log_group" {
22
name = "${var.domain_name}-log_group"
33
tags = var.tags
4+
retention_in_days = var.log_publishing_options_retention
45
}
56

67
resource "aws_cloudwatch_log_resource_policy" "es_aws_cloudwatch_log_resource_policy" {

variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ variable "log_publishing_options_enabled" {
268268
default = true
269269
}
270270

271+
variable "log_publishing_options_retention" {
272+
description = "Retention in days for the created Cloudwatch log group"
273+
type = number
274+
default = 90
275+
}
276+
277+
271278
# cognito_options
272279
variable "cognito_options" {
273280
description = "Options for Amazon Cognito Authentication for Kibana"

0 commit comments

Comments
 (0)