Skip to content

Error internal validation failed; object ID #321

@sdubey472

Description

@sdubey472

provider "restapi" {
alias = "restapi_headers"
uri = "https://api.imperva.com"
write_returns_object = true
debug = true

headers = {
"x-api-key" : var.,
"x-api-id" : var.I
,
"Content-Type" = "application/json"

}
create_method = "PUT"
update_method = "PUT"
destroy_method = "PUT"
}

resource "restapi_object" "site" {
provider = restapi.restapi_headers
path = "/sites-mgmt/v3/sites?caid=2212064"
data = jsonencode({ "name" = "abpmoduletestsite.standard.com", "type" = "CLOUD_WAF" })
create_method = "POST"
id_attribute = "data.0.id"
}

Also I have checked same through direct restapi call I am getting below response

{"data":[
{"id":373884525,
"name":"MyDemoSite",
"type":"CLOUD_WAF",
"accountId":[ACCOUNT_ID],
"creationTime":1713095076247,
"cname":"
**.ng.impervadns.net"}]}

the resource is created But still I am getting below error.

│ Error: internal validation failed; object ID is not set, but may have been created; this should never happen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions