Skip to content

Atlantis with terragrunt ignores files from subdirectories #2603

Open
@ThiagoMartinsdeMelo

Description

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

Hi,

We have a project that we are using the terragrunt workflow and the '--autoplan-file-list' flag does not consider *.json, *.yaml, *.yml files that are in subdirectories of the terragrunt structure.

Our file structure follows this format:

.
└── live
    ├── prod
    │   ├── main.tf
    │   ├── terragrunt.hcl
    │   └── policies
    │       └──iam.json
    └── staging
        ├── main.tf
        ├── terragrunt.hcl
        └── policies
            └──iam.json

If we change a value in the iam.json file, atlantis does not detect the file change and does not perform the 'auto plan'.

We have already added the values that detect this modification to the '--autoplan-file-list' flag. Example:
**/config\\-*.json, so the plan goes to the policies directory and not the prod directory.

Reproduction Steps

Logs

exit status 1: running "terragrunt plan -no-color -out=$PLANFILE" in "/atlantis-data/repos/iac-project/446/default/atlantis/policies": 
time=2022-10-19T19:47:45Z level=error msg=Error reading file at path /atlantis-data/repos/iac-project/446/default/atlantis/policies/terragrunt.hcl: open /atlantis-data/repos/iac-project/446/default/atlantis/policies/terragrunt.hcl: no such file or directory
time=2022-10-19T19:47:45Z level=error msg=Unable to determine underlying exit code, so Terragrunt will exit with error code 1

Environment details

Atlantis version: v0.19.2

Atlantis server-side config file:

---
  repos:
  - id: /.*/
    apply_requirements: [approved]
    allow_custom_workflows: true
    workflow: terragrunt
    delete_source_branch_on_merge: true
    allowed_overrides: [apply_requirements, workflow, delete_source_branch_on_merge]
  workflows:
    terragrunt:
      plan:
        steps:
          - run: terragrunt plan -no-color -out=$PLANFILE
      apply:
        steps:
          - run: terragrunt apply -no-color $PLANFILE

Repo atlantis.yaml file:

none

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedGood feature for contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions