Closed erademacher closed 1 year ago
The issue is we are using
tfsdk.UseStateForUnknown()
for the id attribute and this is used for computed attributes which are known to not change over time. This will produce the following error on the TF apply command while setting the TF state after updating.
I see. Thanks for clarifying! I had a wrong understanding of UseStateForUnknown. Fortunately, though, I just double checked the CCAPI's update allowlist endpoint, and it doesn't let you modify the CIDR address anyway. I marked both CIDR fields as RequiresReplace
. The SQL user schema should still be OK, but I'll revisit the cluster schema in another PR.
I tested the update operation for all fields in the allowlist resource and didn't see any errors or get it into a bad state, so hopefully we're good now.
TFTR!
Since the ID is based on the CIDR address, it needs to be recomputed when the address is updated.