terraform-provider-restapi icon indicating copy to clipboard operation
terraform-provider-restapi copied to clipboard

Error: : invalid or unknown key: id

Open o1da opened this issue 3 years ago • 6 comments

Hi, I wanted to force ID of a resource to fixed value, so I tried to use optional parameter id (String, Optional) The ID of this resource.

But terraform (1.0.9) is returning Error: : invalid or unknown key: id isn't id protected attribute or something? https://github.com/DataDog/terraform-provider-datadog/issues/947

I am using restapi provider in version 1.15.0 (I can't use 1.16.0 due issues with state read of externally deleted resources https://github.com/Mastercard/terraform-provider-restapi/issues/77)

o1da avatar Oct 21 '21 11:10 o1da

Hi, @o1da - you are correct... we're seeing the same thing that the datadog folks saw - the autogenerated docs are spitting out data fields that the provider doesn't actually expose.

I'll look into why that is happening. A cursory look at the datadog commit history shows they had to fix the doc manually, but that won't quite work out for this project since the generation of the docs is part of the release process.

I'll have to do some spelunking...

DRuggeri avatar Feb 02 '22 16:02 DRuggeri

Hello! I've also faced similar issue. The API endpoint that I'm using has response code "204 No content" and the response body is empty. This way the resource ID can't be detected: internal validation failed; object ID is not set, but *may* have been created; this should never happen

If I try to set the ID manually i get the error invalid or unknown key: id

ghost avatar Feb 15 '22 13:02 ghost

I'm having the same issue. Did you manage to get this resolved ?

arunsudhakar avatar Mar 11 '22 07:03 arunsudhakar

+1

thierryturpin avatar May 27 '22 10:05 thierryturpin

+1

Scholdan avatar Aug 03 '22 07:08 Scholdan

+1

matthowardcohere avatar Nov 02 '22 21:11 matthowardcohere