Closed aussietexan closed 1 year ago
Hey @aussietexan , you can access to id returned by API if you do it like this:
ciscoise_trusted_certificate_import.example.item.0.id
You can see all item
struct on tfstate
file
Thanks @fmunozmiranda. I confirmed that the 'item.0.id' does match the 'id' value from the API. Please feel free to close this issue.
Happy to help.
Environment:
Describe the bug Using the resource 'ciscoise_trusted_certificate_import' with the required parameters works as expected to imported a CA certificate into the ISE Trusted Certificates store. However, the {id} value returned and tracked by terraform state does not reflect the ID value returned by a GET request from the API.
Expected behavior The {id} value tracked by TF state should be equal to the ID generated by the object creation in ISE. This needs to be the same as the ID used by the API so that any subsequent operations are executed on the correct object in ISE.
For example, the value of 'ciscoise_trusted_certificate_import.example.id' should be equal to the "id" value from the API.
Example output from TF apply Plan: 1 to add, 0 to change, 0 to destroy. ciscoise_trusted_certificate_import.root-ca-ise31-2: Creating... ciscoise_trusted_certificate_import.root-ca-ise31-2: Creation complete after 2s [id=1665444832]
ID from API GET request '/api/v1/certs/trusted-certificate' (snipped) { "id": "13cafff4-8acf-46a0-af0d-465015ee5b79"