TerraformRemoteState to read outputs from a previously deployed stack.
Data Sources for Remote State
tfts provides several implementations ofTerraformRemoteState depending on your backend:
DataTerraformRemoteStateLocal: For local state files.DataTerraformRemoteStateS3: For state stored in Amazon S3.DataTerraformRemoteStateGcs: For state stored in Google Cloud Storage.DataTerraformRemoteStateAzurerm: For state stored in Azure Blob Storage.
Accessing Outputs
Once you have defined a remote state data source, you can access its outputs using typed getter methods.get(outputName)getString(outputName)getNumber(outputName)getList(outputName)getBoolean(outputName)
Cross-Stack References
If you are managing multiple stacks within the sameApp, you can use app.crossStackReference() to automatically handle the dependency and state sharing.