Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge the "skip" attribute from included terragrunt files is not supported #3224

Closed
2 tasks
rodrigorfk opened this issue Jun 24, 2024 · 4 comments · Fixed by #3225
Closed
2 tasks

Merge the "skip" attribute from included terragrunt files is not supported #3224

rodrigorfk opened this issue Jun 24, 2024 · 4 comments · Fixed by #3225
Assignees
Labels
bug Something isn't working

Comments

@rodrigorfk
Copy link
Contributor

Describe the bug

The current Terragrunt documentation, specifically the section on the skip attribute here, stipulates that this flag must be explicitly set within Terragrunt modules that are intended to be skipped. This implies that the configuration will not be inherited from include blocks. Despite this being clearly documented, it appears to contradict the merging concept supported by the include block.

From a user's standpoint, it would be beneficial to have the ability to inherit this flag/attribute, similar to how many other attributes are inherited. Is there a specific rationale behind the distinct treatment of this attribute that I may be overlooking?

Steps To Reproduce

Create a partial terragrunt hcl file

partial.hcl

locals {
  module_path_parts = split("/", path_relative_to_include())
  module_base_path  = local.module_path_parts[0]
  module_name       = join("_", slice(local.module_path_parts, 1, length(local.module_path_parts)))
}

skip = !endswith(local.module_name, "_account_layer")

Include the partial file in a live module

partial.hcl

include {
  path   = find_in_parent_folders("partial.hcl")
  expose = true
}

Expected behavior

As you can see, the skip in the partial terragrunt file does not contain a simple true or false, it contains a more advanced logic that I would like to inherit in included modules, without having to duplicate the logic there, currently that is not possible because the skip attribute is not included.

Nice to haves

  • Terminal output
  • Screenshots

Versions

  • Terragrunt version: v0.59.5
  • OpenTofu/Terraform version: 1.5.5
  • Environment details (Ubuntu 20.04, Windows 10, etc.): macOS 14.x

Additional context

Add any other context about the problem here.

@yhakbar
Copy link
Collaborator

yhakbar commented Jun 24, 2024

Hey @rodrigorfk ,

Thanks for opening this issue, and supplying a pull request to address your needs. Your initiative is appreciated!

We will need to take some time to review this logic, and make sure it doesn't impact anything too severely, as it is a breaking change in what's expected from an include.

To be transparent, I don't know why skips aren't included right now, but there's likely a good reason, and we want to make sure those are understood before merging anything in.

@rodrigorfk
Copy link
Contributor Author

Hi @yhakbar, thank you very much for providing a follow up here, I completely understand the suggested changed needs some time to be evaluated, once you deliberate about it, please let me know if I can help with anything else regarding to it. Thanks again.

@yhakbar
Copy link
Collaborator

yhakbar commented Jun 25, 2024

The context on this is that skip used to be part of a legacy terragrunt field that no longer exists. At the time, it didn't make sense to allow the skip to be included, but it's totally fine now.

How we handle skips is something that we're working on actively, and is likely to change over time, particularly if the following RFC is accepted:
#3134

@yhakbar
Copy link
Collaborator

yhakbar commented Oct 7, 2024

Fix pre-released in v0.68.0-beta2024100701. Will be included in the next minor release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants