hashicorp / terraform-aws-consul

A Terraform Module for how to run Consul on AWS using Terraform and Packer
Apache License 2.0
401 stars 488 forks source link

`terraform init` failing #195

Closed dnk8n closed 4 years ago

dnk8n commented 4 years ago

Update: So sorry, totally my fault. I accidentally made the following edit of the git submodule instead of the copied template. Not an issue at all. The problem exists between chair and keyboard.

-  # source = "git::git@github.com:hashicorp/terraform-aws-consul.git//modules/consul-cluster?ref=v0.0.1"
-  source = "./modules/consul-cluster"
+  source = "git::git@github.com:hashicorp/terraform-aws-consul.git//modules/consul-cluster?ref=v0.8.0"

terraform --version Terraform v0.13.5

Please see the following codebase for templates used: https://github.com/dnk8n/monitored-orchestration

From there I:

  1. cp .envrc.tpl .envrc and fill in the AWS credential environment variables, and AMI id (note the use of direnv, but you should also just be able to source .envrc

  2. cd src/consul

  3. terreform init

Output:

Initializing modules...
- consul_clients in 
Downloading git::git@github.com:hashicorp/terraform-aws-consul.git?ref=v0.8.0 for consul_servers...
- consul_servers in .terraform/modules/consul_servers/modules/consul-cluster
- consul_servers.iam_policies in .terraform/modules/consul_servers/modules/consul-iam-policies
- consul_servers.security_group_rules in .terraform/modules/consul_servers/modules/consul-security-group-rules
- consul_servers.security_group_rules.client_security_group_rules in .terraform/modules/consul_servers/modules/consul-client-security-group-rules

Error: Unreadable module directory

Unable to evaluate directory symlink: lstat modules: no such file or directory

Error: Failed to read module directory

Module directory  does not exist or cannot be read.

Error: Unreadable module directory

Unable to evaluate directory symlink: lstat modules: no such file or directory

Error: Failed to read module directory

Module directory  does not exist or cannot be read.

Error: Unreadable module directory

Unable to evaluate directory symlink: lstat modules: no such file or directory

Error: Failed to read module directory

Module directory  does not exist or cannot be read.

Error: Unreadable module directory

Unable to evaluate directory symlink: lstat modules: no such file or directory

Error: Failed to read module directory

Module directory  does not exist or cannot be read.

Error: Unreadable module directory

Unable to evaluate directory symlink: lstat modules: no such file or directory

Error: Failed to read module directory

Module directory  does not exist or cannot be read.

Error: Unreadable module directory

Unable to evaluate directory symlink: lstat modules: no such file or directory

Error: Failed to read module directory

Module directory  does not exist or cannot be read.

If I cd to the path module and do terraform init from there, it works. Previously thought by hardcoding the path.module environment variable I got it to work, but actually it was because I was cd'd to the path.module directory.