Terraform no escape sequence for curly braces {} v1.0.2

Terraform v1.0.2
on windows_amd64

Resource: azurerm_api_management_api_operation
url_template = “GetCommercialParcelById/{id}”

The {id} is failing because of the curly braces. I have tried to escape them with no luck.

This is the error i am receiving:

Error: creating/updating API Operation apimanagement.APIOperationClient#CreateOrUpdate: Failure responding to request: StatusCode=400 – Original Error: autorest/azure: Service returned an error. Status=400 Code=“ValidationError” Message=“One or more fields contain incorrect values:” Details=[{“code”:“ValidationError”,“message”:“All template parameters used in the UriTemplate must be defined in the Operation, and vice-versa.”,“target”:“templateParameters”}]

Any help with resolving this would be greatly appreicated.

It’s not the curly braces causing the error. You also need to define the parameter in a template_parameter block, e.g.

  template_parameter {
    name     = "id"
    required = true
    type     = "integer"