Skip to content

Commit

Permalink
fix: remove variable from readme that doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Langleu committed Oct 29, 2024
1 parent eda4648 commit d08ed5c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 33 deletions.
1 change: 0 additions & 1 deletion modules/opensearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ module "opensearch_domain" {
advanced_security_master_user_name = "admin"
advanced_security_master_user_password = "password"
encrypt_at_rest_kms_key_id = "kms-key-id"
access_policies = <<EOF
{
"Version": "2012-10-17",
Expand Down
31 changes: 0 additions & 31 deletions modules/opensearch/log.tf

This file was deleted.

31 changes: 30 additions & 1 deletion modules/opensearch/monitoring.tf
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
# TODO: add monitoring
resource "aws_cloudwatch_log_group" "log_group" {
count = length(var.log_types) > 0 ? 1 : 0
name = "${var.domain_name}-os-logs"
}

data "aws_iam_policy_document" "log_policy_document" {
count = length(var.log_types) > 0 ? 1 : 0
statement {
effect = "Allow"

principals {
type = "Service"
identifiers = ["es.amazonaws.com"]
}

actions = [
"logs:PutLogEvents",
"logs:PutLogEventsBatch",
"logs:CreateLogStream",
]

resources = ["arn:aws:logs:*"]
}
}

resource "aws_cloudwatch_log_resource_policy" "log_policy" {
count = length(var.log_types) > 0 ? 1 : 0
policy_name = "${var.domain_name}-os-log-policy"
policy_document = join("", data.aws_iam_policy_document.log_policy_document[*].json)
}

0 comments on commit d08ed5c

Please sign in to comment.