Skip to content

creating and deleting an API object that is referenced as a UUID explicitely in the URL path #59

Description

@fchmainy

the API i am using can creates (POST) an object, the result of the creation is a UUID returned in a JSON response. The suppression of the same objet (DELETE) is done using the object UUID referenced in the delete_url request.

for example

resource "terracurl_request" "myobject" {
    ...
    url = "https://10.1.11.111/api/v1/objects"
    ...
}
output "id" {
    value = jsondecode(terracurl_request.myobject.response.id)
}

the "id" is the UUID of the object which is used as the reference for the object suppression.

the destroy_url is then

destroy_url = "https://10.1.11.111/api/v1/objects/<UUIDv4_value>"
destroy_method = "DELETE"

could you help me understand is there are any way moving forward?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions