terraform-provider-sumologic
terraform-provider-sumologic copied to clipboard
Creating a field with upper-case name results in weird state
Steps to reproduce
- Define a field which uses some upper-case characters in its name, e.g.
resource "sumologic_field" "TotallyDifferent" {
count = 1
field_name = "TotallyDifferent"
data_type = "String"
state = "Enabled"
}
terraform apply
Observed
- As observed in the UI, the lower-case variant of the field is created, e.g.
totallydifferent: - Terraform returns an error with a weird error message:
│ Error: Field "TotallyDifferent" not found
│
│ with sumologic_field.TotallyDifferent[0],
│ on a.tf line 19, in resource "sumologic_field" "TotallyDifferent":
│ 19: resource "sumologic_field" "TotallyDifferent" {
Expected
- Consistent policy on whether field names should be all lower-case or not
- As a consequence of that, proper handling of mixed-case names
After a sequence of these operations, there's no (?) way to undo the damage from the Terraform itself. It looks like one needs to:
- Delete the field in the UI
terraform state rm 'sumologic_field.TotallyDifferent[0]'
Creating an all lower-case field works as expected.