segmentio / terraform-provider-segment

Terraform provider for Segment, using the Public API
https://registry.terraform.io/providers/segmentio/segment/latest
MIT License
27 stars 3 forks source link

.type 'type' must be in all uppercase, got: TEXT_MAP #69

Closed adrian-ludwig closed 11 months ago

adrian-ludwig commented 11 months ago

Description

In resource segment_function settings array cannot have a setting property of type TEXT_MAP

{
      name        = "mapping"
      label       = "Keys Mapping"
      type        = "TEXT_MAP"
      description = "Map Journey properties from one to another that will be saved in Segment Profiles"
      required    = false
      sensitive   = false
    }

Error is always returned:

Attribute settings[Value({"description":"Map Journey properties from one to another that will be saved in Segment Profiles","label":"Keys Mapping","name":"mapping","required":false,"sensitive":false,"type":"TEXT_MAP"})].type 'type' must be in all uppercase, got: TEXT_MAP

To Reproduce

Example Terraform code that triggers the issue:

resource "segment_function" "xxx" {
  code          = file("../code/destination/xxxx.js")
  display_name  = "X"
  logo_url      = "https://cdn-devcenter.segment.com/8686f0d1-b0a8-42d4-b36c-bad1b91dc1e6.png"
  resource_type = "DESTINATION"
  description   = "X"
  settings = [
    {
      name        = "mapping"
      label       = "X"
      type        = "TEXT_MAP"
      description = "XXX"
      required    = false
      sensitive   = false
    }
  ]
}

Worth to note, resource xxx is imported (we want to move deployment of functions to terraform)