Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't disable Cloudwatch Logs #43

Closed
dfassbender opened this issue May 14, 2024 · 1 comment · Fixed by #44
Closed

Can't disable Cloudwatch Logs #43

dfassbender opened this issue May 14, 2024 · 1 comment · Fixed by #44
Assignees
Labels
bug Something isn't working

Comments

@dfassbender
Copy link

We used the Terraform module to setup an AWS Opensearch domain with the default input values for log_publishing_options. So the Index Slow Logs were enabled for the Domain and a Cloudwatch Log Group for them was created.

Now we want to disable this Log Type and set the following value for log_publishing_options in the Terraform module.

log_publishing_options = {
    index_slow_logs = {
      enabled = false
    }
  }

The output of Terraform looks like expected. The Cloudwatch Log Group should be deleted and the Log Type should be removed.

Terraform will perform the following actions:

  # module.opensearch_test.module.opensearch.aws_cloudwatch_log_group.aos["search_slow_logs"] will be destroyed
  # (because key ["search_slow_logs"] is not in for_each map)
  - resource "aws_cloudwatch_log_group" "aos" {
      - arn               = "arn:aws:logs:eu-central-1:XXXXXXXXXXXX:log-group:/aws/OpenSearchService/domains/search-test-min-dev-tfzvxks/search_slow_logs" -> null
      - id                = "/aws/OpenSearchService/domains/search-test-min-dev-tfzvxks/search_slow_logs" -> null
      - log_group_class   = "STANDARD" -> null
      - name              = "/aws/OpenSearchService/domains/search-test-min-dev-tfzvxks/search_slow_logs" -> null
      - retention_in_days = 7 -> null
      - skip_destroy      = false -> null
      - tags              = {} -> null
      - tags_all          = {} -> null
    }

  # module.opensearch_test.module.opensearch.aws_opensearch_domain.this will be updated in-place
  ~ resource "aws_opensearch_domain" "this" {
        id                 = "arn:aws:es:eu-central-1:XXXXXXXXXXXX:domain/search-test-min-dev-tfzvxks"
 
        # (10 unchanged attributes hidden)

      - log_publishing_options {
          - cloudwatch_log_group_arn = "arn:aws:logs:eu-central-1:XXXXXXXXXXXX:log-group:/aws/OpenSearchService/domains/search-test-min-dev-tfzvxks/index_slow_logs" -> null
          - enabled                  = true -> null
          - log_type                 = "INDEX_SLOW_LOGS" -> null
        }

        # (12 unchanged blocks hidden)
    }

After the apply of Terraform the Log Group was deleted, but the Log Type Index Slow Logs is still active and the deleted Log Group is also referenced in the configuration of the Domain.

@abhinavkumarsph abhinavkumarsph self-assigned this May 21, 2024
@abhinavkumarsph abhinavkumarsph added the bug Something isn't working label May 21, 2024
@abhinavkumarsph abhinavkumarsph linked a pull request May 21, 2024 that will close this issue
@abhinavkumarsph
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants