Below is my directory structure
├── applications
│ ├── app01
│ │ ├── main.tf
│ │ ├── output.tf
│ │ ├── provider.tf
│ │ └── variables.tf
│ └── app02
│ ├── main.tf
│ ├── output.tf
│ ├── provider.tf
│ └── variables.tf
├── app_sg
│ └── main.tf
└── modules
├── instance
│ ├── main.tf
│ ├── output.tf
│ └── variables.tf
├── sg
│ ├── main.tf
│ ├── output.tf
│ └── variables.tf
└── volume
├── main.tf
├── output.tf
└── variables.tf
From the structure mentioned, the instance and volume resources were re-usable and common across the applications. On each application, I'm writing two modules (Instance creation and volume creation with attachment). Please let me know how to refer the instance IDs for volume attachment.