For most resources, this is a simple find & replace.
For the database resource, I had it read the database from the create response and load it into the state instead of copying the plan (which can contain unknowns).
Private endpoint services is a weird case. Apparently, Terraform doesn't like it when Unknown values are loaded into non-Terraform types. Thankfully, this is only a problem for fully computed attributes. Required and optional attributes are loaded as nil. To resolve this, though, I had to change the data type for services to types.List and pass in the exact schema type to its constructor. I pulled the schema object out of the Schema method so I could extract the attribute type without dupicating code.
For most resources, this is a simple find & replace.
For the database resource, I had it read the database from the create response and load it into the state instead of copying the plan (which can contain unknowns).
Private endpoint services is a weird case. Apparently, Terraform doesn't like it when Unknown values are loaded into non-Terraform types. Thankfully, this is only a problem for fully computed attributes. Required and optional attributes are loaded as nil. To resolve this, though, I had to change the data type for
services
totypes.List
and pass in the exact schema type to its constructor. I pulled the schema object out of the Schema method so I could extract the attribute type without dupicating code.Commit checklist
make generate
)