Exec code without null resource?

Is it possible to exec some code (in whatever language we’re coding in, e.g. C#) after a resource has been created? In HCL, we typically used a null resource and pointed it at a script, but how can we do it now without following the same pattern?

It would be awkward to have to create a null resource just to point it to itself to execute some code.

A provisioner can be added to any managed resource, but if there is no single existing resource which makes sense to put the provisioner, a null_resource is just fine.

Using a null_resource isn’t creating anything externally, its only job is to manage the lifecycle of that bit if data in order to do things like trigger a provisioner. The only awkwardness is that Terraform itself isn’t necessarily well-suited for running external code, see Provisioners are a Last Resort