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

Creating project in a module where atlantis_skip is set to true

Open pantelis-karamolegkos opened this issue 2 years ago • 4 comments

I have a large monorepo incorporating both modules and live section.

I am running

$ terragrunt-atlantis-config generate --apply-requirements approved,mergeable --output atlantis.yaml --autoplan --parallel

on the root of the repo.

At one of the modules the process fails:

Error: /Users/pantelis/Workspace/myproject/terragrunt/live/environment1/setup1/stg1/something/somethingelse/terragrunt.hcl:23,14-14: Missing required argument; The argument "paths" is required, but no definition was found.
Usage:...

However, in this specific file:

locals {
  atlantis_skip = true
}

pantelis-karamolegkos avatar Mar 07 '22 09:03 pantelis-karamolegkos

Is the file that contains

locals {
  atlantis_skip = true
}

meant to be parseable by terragrunt? If this lib can't parse the file, then it can't parse out the locals values.

Though we can possibly add a workaround if you could add some more information or could create a test case that shows this error

dmattia avatar Mar 07 '22 14:03 dmattia

You are right, the terragrunt.hcl where the locals snippet above was added was not parseable due to syntactic errors.

The actual error was that it had a malformed dependencies block where the actual dependencies were mistakenly commented out, as in

dependencies {
  # paths = ["../../../something", "../../somethingelse"]
}

(dunno if this helps contributing a case-specific test)

pantelis-karamolegkos avatar Mar 07 '22 14:03 pantelis-karamolegkos

Thanks @pantelis-karamolegkos, that does help. Maybe we could have a feature request that just reads in the file in plain text and searches for the string atlantis_skip = true in the case where the file cannot be parsed?

I don't love that but I also don't hate it, so if you have a use case for it I wouldn't mind adding it

dmattia avatar Mar 08 '22 17:03 dmattia

I think that would be a helpful (although not indispensable) feature, to be able to skip any atlantis action if the atlantis_skip local is set to true

pantelis-karamolegkos avatar Mar 08 '22 20:03 pantelis-karamolegkos