I am attempting to run terraspace plan in a stack that references a module, the output looks good when I run terraspace init, it successful fetches the module however when I run terraspace plan I get an error that the module isn’t installed.
Below is my output:
**$** AWS_REGION=eu-west-1 TS_ENV=new-schema terraspace init sqs
Building .terraspace-cache/eu-west-1/new-schema/stacks/sqs
Built in .terraspace-cache/eu-west-1/new-schema/stacks/sqs
Current directory: .terraspace-cache/eu-west-1/new-schema/stacks/sqs
=> terraform init -get -input=false
**Initializing modules...**
- mailer-queue in ../../modules/sqs
- verification-status-queue in ../../modules/sqs
**Initializing the backend...**
**Initializing provider plugins...**
- Reusing previous version of hashicorp/aws from the dependency lock file
- Using previously-installed hashicorp/aws v4.3.0
**Terraform has been successfully initialized!**
You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
**at** **MacBook-Pro-2** **in** **~/GolandProjects/tf** **on** **master** **[+!?$]**
**$** AWS_REGION=eu-west-1 TS_ENV=new-schema terraspace plan sqs
Building .terraspace-cache/eu-west-1/new-schema/stacks/sqs
Built in .terraspace-cache/eu-west-1/new-schema/stacks/sqs
Current directory: .terraspace-cache/eu-west-1/new-schema/stacks/sqs
=> terraform plan -input=false
╷
│ **Error:** **Module not installed**
│
│ on main.tf line 1:
│ 1: module "verification-status-queue" {
│
│ This module's local cache directory could not be read. Run "terraform
│ init" to install all modules required by this configuration.
╵
╷
│ **Error:** **Module not installed**
│
│ on main.tf line 6:
│ 6: module "mailer-queue" {
│
│ This module's local cache directory could not be read. Run "terraform
│ init" to install all modules required by this configuration.
╵
Error running command: terraform plan -input=false
Is there an extra step I need to install modules within the Terraspace modules folder?
Building .terraspace-cache/westeurope/dev/stacks/es
Created .terraspace-cache/westeurope/dev/modules/common-tags/main.tf
Created .terraspace-cache/westeurope/dev/modules/common-tags/outputs.tf
Created .terraspace-cache/westeurope/dev/modules/common-tags/variables.tf
Terraspace::Builder::Children @queue [common-tags]
Created .terraspace-cache/westeurope/dev/stacks/common-tags/backend.tf
Created .terraspace-cache/westeurope/dev/stacks/common-tags/provider.tf
Created .terraspace-cache/westeurope/dev/stacks/common-tags/main.tf
Created .terraspace-cache/westeurope/dev/stacks/common-tags/outputs.tf
Created .terraspace-cache/westeurope/dev/stacks/common-tags/variables.tf
Layers for common-tags:
app/stacks/common-tags/tfvars/base.tfvars
Created .terraspace-cache/westeurope/dev/stacks/common-tags/1-base.auto.tfvars
Created .terraspace-cache/westeurope/dev/stacks/es/backend.tf
Created .terraspace-cache/westeurope/dev/stacks/es/provider.tf
Created .terraspace-cache/westeurope/dev/stacks/es/main.tf
Created .terraspace-cache/westeurope/dev/stacks/es/variables.tf
Layers for es:
app/stacks/es/tfvars/base.tfvars
app/stacks/es/tfvars/dev.tfvars
config/stacks/es/tfvars/dev.tfvars
Downloading tfstate files for dependencies defined in tfvars...
Downloading tfstate for stack: common-tags
=> cd /XXX/terraspace-elk-infra/.terraspace-cache/westeurope/dev/stacks/common-tags && terraform state pull > /tmp/terraspace/remote_state/stacks/common-tags/state.json
╷
│ Error: Module not installed
│
│ on /XXX/terraspace-elk-infra/.terraspace-cache/westeurope/dev/stacks/common-tags/main.tf line 1:
│ 1: module "common_tags" {
│
│ This module is not yet installed. Run "terraform init" to install all modules required by this configuration.
╵
Error running: cd /XXX/terraspace-elk-infra/.terraspace-cache/westeurope/dev/stacks/common-tags && terraform state pull > /tmp/terraspace/remote_state/stacks/common-tags/state.json
Please fix the error before continuing
DEBUG: (Output tags could not be looked up for the es tfvars file. common-tags stack needs to be deployed)
Created .terraspace-cache/westeurope/dev/stacks/es/1-base.auto.tfvars
Created .terraspace-cache/westeurope/dev/stacks/es/2-dev.auto.tfvars
Created .terraspace-cache/westeurope/dev/stacks/es/3-dev.auto.tfvars
Built in .terraspace-cache/westeurope/dev/stacks/es