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

bug: sort issue for "Cloud" event_categories for the lacework_alert_rule resource #442

Open
dli-spoton opened this issue Jan 27, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@dli-spoton
Copy link

Describe the bug
The "Cloud" item in event_categories for lacework_alert_rule is always sorted to the last item in the list. Will result in perpetual drift for the resource if Terraform doesn't match. Doesn't seem to be the case for any of the other items in event_categories.

To Reproduce

resource "lacework_alert_rule" "jira" {
  name           = "jira-alert-rule"
  description    = "This is a test JIRA alert rule"
  alert_channels = [lacework_alert_channel_jira_cloud.jira.id]
  severities = [
    "Critical",
    "High",
  ]
  event_categories = [
    "App",
    "Cloud",
    "Compliance",
    "File",
    "Machine",
    "User",
    "Platform",
  ]
}
  1. Terraform apply
  2. Terraform plan
  # lacework_alert_rule.jira will be updated in-place
  ~ resource "lacework_alert_rule" "jira" {
      ~ event_categories        = [
            "App",
          + "Cloud",
            "Compliance",
            # (3 unchanged elements hidden)
            "Platform",
          - "Cloud",
        ]
        name = "jira-alert-rule"
        # (9 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
  1. Terraform apply
  2. Terraform plan
Terraform will perform the following actions:

  # lacework_alert_rule.jira will be updated in-place
  ~ resource "lacework_alert_rule" "jira" {
      ~ event_categories        = [
            "App",
          + "Cloud",
            "Compliance",
            # (3 unchanged elements hidden)
            "Platform",
          - "Cloud",
        ]
        name = "jira-alert-rule"
        # (9 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Expected behavior
Changing the order of event_categories should not result in perpetual drift.

Please complete the following information):

  • MacOS v12.6.2
  • Terraform v1.3.1
  • provider registry.terraform.io/lacework/lacework v1.4.0
@dli-spoton dli-spoton added the bug Something isn't working label Jan 27, 2023
@dmurray-lacework
Copy link
Collaborator

Hi @dli-spoton thank you for reporting this issue. I've raised an issue internally for this.
https://lacework.atlassian.net/browse/GROW-1373

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

No branches or pull requests

2 participants