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

Cannot configure http log streaming due to bad validation rule #780

Open
tom-mckay opened this issue Mar 8, 2024 · 0 comments
Open

Cannot configure http log streaming due to bad validation rule #780

tom-mckay opened this issue Mar 8, 2024 · 0 comments

Comments

@tom-mckay
Copy link

We are seeing an error when creating an hcp_vault_cluster resource:

Error: http configuration is invalid: allowed values for http_codec are only "JSON" or "NDJSON"

The resource includes an audit_log_config like this:

resource "hcp_vault_cluster" "vault_cluster" {
...snip...
  audit_log_config {
    http_codec = "JSON"
    http_method = "POST"
    http_uri = var.sumologic_collector_url
  }
}

It seems like this code is checking the wrong variable:

if strings.ToUpper(httpMethod) != "JSON" && strings.ToUpper(httpMethod) != "NDJSON" {
invalidProviderConfigError = diag.Errorf("http configuration is invalid: allowed values for http_codec are only \"JSON\" or \"NDJSON\"")
}

httpMethod should probably be httpCodec here. The lines prior to this already validated httpMethod. This looks like a copy/paste error.

@jaireddjawed jaireddjawed mentioned this issue Mar 8, 2024
3 tasks
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

No branches or pull requests

1 participant