terragrunt-atlantis-config icon indicating copy to clipboard operation
terragrunt-atlantis-config copied to clipboard

Failed to read module directory

Open Chancebair opened this issue 2 years ago • 2 comments

What is the issue?

On my atlantis pod, in the directory /atlantis-data/repos/devops/terraform/723/default I'm running:

terragrunt-atlantis-config generate --output test.yaml --filter './live/' --parallel --create-workspace

And receiving

Error: Failed to read module directory: Module directory /atlantis-data/repos/devops/terraform/723/default/live/development/terragrunt.hcl/../../..//monorepo/platform/gitlab/atlantis-target does not exist or cannot be read.

Why isn't this being shown as a parent terragrunt?

remote_state {
  backend = "s3"
  generate = {
    path      = "backend.tf"
    if_exists = "overwrite_terragrunt"
  }
  config = {
    bucket   = "around-terragrunt-development"
    key      = "${path_relative_to_include()}/terraform.tfstate"
    role_arn = "arn:aws:iam::XXX:role/atlantis-target"
    region   = "eu-central-1"
    encrypt  = true
  }
}

generate "provider" {
  path      = "provider.tf"
  if_exists = "overwrite_terragrunt"
  contents  = <<EOF
provider "aws" {
  allowed_account_ids = ["XXX"]
  region  = "eu-central-1"
  assume_role {
    role_arn     = "arn:aws:iam::XXX:role/atlantis-target"
    session_name = "development"
  }
}
EOF
}

terraform_version_constraint = ">= 0.14.7"

locals {
  environment   = "development"
  region        = "eu-central-1"
  cluster_names = ["esel", "indie"]
  is_parent_terragrunt_file = true
}

live/development/terragrunt.hcl

The repository structure is as follows:

.
├── live
│   ├── development
│   │   ├── apps
│   │   ├── platform
│   │   └── terragrunt.hcl
│   ├── kaeuferportal
│   │   ├── platform
│   │   └── terragrunt.hcl
│   ├── other
│   │   └── data
│   ├── production
│   │   ├── apps
│   │   ├── platform
│   │   ├── terraform
│   │   └── terragrunt.hcl
│   ├── services
│   │   ├── apps
│   │   ├── datadog
│   │   ├── platform
│   │   ├── terraform
│   │   └── terragrunt.hcl
│   └── staging
│       ├── apps
│       ├── platform
│       ├── terraform
│       └── terragrunt.hcl
├── modules
...
└── monorepo
...

Versions

bash-5.1$ terragrunt-atlantis-config version
terragrunt-atlantis-config '1.12.3'

Chancebair avatar Feb 14 '22 11:02 Chancebair

Could you upload a minimal example showing this error to the https://github.com/transcend-io/terragrunt-atlantis-config/tree/master/test_examples directory in a new PR, and I can update code/tests until it builds the desired output?

dmattia avatar Feb 14 '22 14:02 dmattia

This looks like my failure: https://github.com/transcend-io/terragrunt-atlantis-config/runs/5187282501?check_suite_focus=true#step:6:488

Chancebair avatar Feb 14 '22 16:02 Chancebair