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

Terraform Provider Does Not Support Hyphen in Custom Properties Configuration #40

Closed
leij-splunk opened this issue Jan 23, 2024 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@leij-splunk
Copy link

Description:
The current version of the Terraform provider exhibits a limitation by not supporting hyphens in Custom Properties configuration. This deviation poses an inconsistency with the expected behavior and functionality.

Additional Information:

  • Terraform Provider Version: v2.0.3
  • Relevant Code Snippet:
    ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z]\w{1,128}$`), "custom_properties key must start with a letter and only consist of alphanumeric and underscore characters with no whitespace"),

    ValidateFunc: validation.StringMatch(regexp.MustCompile(`^\w{1,256}$`), "custom_properties value can only consist of alphanumeric and underscore characters with no whitespace"),
  • Custom properties Document:
    • Key Requirements:
      • Must start with a letter.
      • Allowed characters include letters, numbers, underscores, and hyphens.
      • Naming restrictions: Can't be named test_id or test.
      • Character limit: Key size cannot exceed 128 characters.
    • Value Requirements:
      • Allowed characters include letters, numbers, underscores, and hyphens.
@greatestusername-splunk
Copy link
Collaborator

Thanks for adding this issue! Will double check the regex with the backend and if other chars are allowed update the validate function!

@bambro
Copy link
Contributor

bambro commented May 13, 2024

@greatestusername-splunk can you confirm the requirements of the property values? Hyphens and other special characters are allowed in the UI however are excluded by terraform

@greatestusername-splunk
Copy link
Collaborator

@bambro
These should work in terraform now. Latest version included an updated regex for allowing hyphens and underscores.

@greatestusername-splunk
Copy link
Collaborator

Closing as #44 should address this issue in full. If it does not please re-open another issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants