You thought you were late - check me out!
I’m fairly new to Terraform and I’m looking at a module that uses a null_resource to derive a value and write it to a file, then uses an external data source to inspect that file and return the value. It seems like this pattern confuses Terraform on runs after the first one - it seems that on later runs if state has not changed, Terraform will not call the null_resource provider to regenerate the file, but it will also never return values from state. Instead it returns the value from the file - if the file is gone it just doesn’t work.
@apparentlymart is this combination of null_resource and external data source what you intended to recommend? Have you seen this problem before? Is there a better way to implement the pattern?