How to give a .tf file as input in Terraform Apply command?

You can’t selectively apply one file and then the other. Two ways of (maybe) achieving what you’re going for:

  • Use the -target flag to target resource(s) in one file and then the other.
  • Put each file (or more broadly, group of resources, which might be multiple files) in separate “modules” (folders). You can then apply them separately.

Leave a Comment

tech