Splitting components into folders
example_service
├── envs # environments setup with Terraform CLI Workspaces
│ ├── dev.tfvars
│ ├── production.tfvars
│ └── staging.tfvars
├── _variables.tf # input variables
├── _outputs.tf # outputs
├── _providers.tf # terraform, provider blocks, external deps, e.g. terraform_remote_state
├── api.tf
├── main_dynamodb.tf
├── lambda.tf
├── logs.tf
├── s3.tf
└── sqs.tf # logical groups of resources
Components can depend on each other with data.terraform_remote_state
resource.