0
votes

I have a terraform template module that looks like this

.
├── example
│   ├── main.tf
│   └── variables.tf
├── policies.tf
├── roles.tf
├── main.tf
├── provider.tf
└── variable.tf

inside the main.tf inside example path I have a resource that depends on a resource that is part of me main.tf how can I call resource with depends_on = [] if they're not part of the same file and path

1
Depends on how? Can you provide a minimal reproducible example that shows what you're trying to do? You might be able to achieve this in some ways or you may need to restructure things but it's hard to know without seeing what you're doing exactly beyond a pseudo file structure. - ydaetskcoR

1 Answers

0
votes

if they're not part of the same file and path

You can't do this. You have to re-think your architecture and probably change it so that such dependency does not happen.