You can very easily reference resources by using an AWS data source (gets resource info directly from the AWS APIs) or using a terraform remote state data source (gets info from the relevant terraform state file outputs).
Another way is to use a KV store, like AWS SSM Parameter Store or consul. This is useful to link your infra to your CI/CD or even directly to your application