How can I retrieve OCI instance OCIDs?

Hi guys, working with OCI and I’m trying to get the instance OCIDS so that I can reference them in locals.tf? Instances are ceated from modules/A/main.tf in and I need to reference OCIDs in modules/B/locals.tf.
I was thinking something like an oci_core_instance.instance.id but had no joy.