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

SUMO-247498 Add hashAlgorithm to common source properties #686

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

yuting-liu
Copy link
Contributor

Add the hashalgorithm field to common source properties.

@yuting-liu
Copy link
Contributor Author

Already tested it locally:

Terraform will perform the following actions:

  # sumologic_collector.collector will be created
  + resource "sumologic_collector" "collector" {
      + id       = (known after apply)
      + name     = "yuting-test-tf-collector"
      + timezone = "Etc/UTC"
    }

  # sumologic_http_source.test-http-source-empty will be created
  + resource "sumologic_http_source" "test-http-source-empty" {
      + automatic_date_parsing       = true
      + category                     = "my/source/category"
      + collector_id                 = (known after apply)
      + cutoff_timestamp             = 0
      + force_timezone               = false
      + id                           = (known after apply)
      + message_per_request          = false
      + multiline_processing_enabled = true
      + name                         = "test-http-source-empty"
      + url                          = (known after apply)
      + use_autoline_matching        = true
    }

  # sumologic_http_source.test-http-source-md5 will be created
  + resource "sumologic_http_source" "test-http-source-md5" {
      + automatic_date_parsing       = true
      + category                     = "my/source/category"
      + collector_id                 = (known after apply)
      + cutoff_timestamp             = 0
      + force_timezone               = false
      + hash_algorithm               = "MD5"
      + id                           = (known after apply)
      + message_per_request          = false
      + multiline_processing_enabled = true
      + name                         = "test-http-source-md5"
      + url                          = (known after apply)
      + use_autoline_matching        = true
    }

  # sumologic_http_source.test-http-source-sha-256 will be created
  + resource "sumologic_http_source" "test-http-source-sha-256" {
      + automatic_date_parsing       = true
      + category                     = "my/source/category"
      + collector_id                 = (known after apply)
      + cutoff_timestamp             = 0
      + force_timezone               = false
      + hash_algorithm               = "SHA-256"
      + id                           = (known after apply)
      + message_per_request          = false
      + multiline_processing_enabled = true
      + name                         = "test-http-source-sha-256"
      + url                          = (known after apply)
      + use_autoline_matching        = true
    }

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

Thus, it will have the consistent behavior as we created sources via UI/API. If hash_algorithm is not explicitly specified, it won't be shown in the source serialization json. If it's explicitly mentioned, it will use either SHA-256 or MD5 as specified.

@yuting-liu yuting-liu merged commit 113a3db into master Sep 26, 2024
7 checks passed
@yuting-liu yuting-liu deleted the yuting-SUMO-247498-fix-hashAlrogithm branch September 26, 2024 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants