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

sops_decrypt_file files arent being listed as dependencies for projects. #107

Open
ryan-dyer-sp opened this issue Jan 25, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ryan-dyer-sp
Copy link

We have in our child terragrunt.hcl

include {
  path = find_in_parent_folders()
}

terraform {
  source = "../../../../../modules//secrets"

  extra_arguments "common_var" {
    commands = [for c in get_terraform_commands_that_need_vars() : c if c != "apply"]

    arguments = [
      "-var-file=${get_terragrunt_dir()}/main.tfvars"
    ]
  }
}

locals {
  secrets = try(jsondecode(sops_decrypt_file("${get_terragrunt_dir()}/../secrets.json")), {})
}

inputs = merge(
  local.secrets
)

Running

> terragrunt-atlantis-config generate --autoplan --create-workspace --create-project-name --output atlantis.yaml --workflow terragrunt --ignore-parent-terragrunt

We dont end up with the secrets.json showing up as a dependency anywhere in our atlantis.yaml.

Am I missing something?

@dmattia
Copy link
Member

dmattia commented Jan 27, 2021

Hello! Great question.

Right now, one of the only things this library does not support are finding values passed to terragrunt functions, and the reason for this is because terragrunt does not directly expose what functions it has called. So when this library sees the parsed result of a terragrunt.hcl file, all the functions are applied already. There is a similar discussion in this issue: #48

I have a WIP PR to fix this issue here: https://github.com/transcend-io/terragrunt-atlantis-config/pull/70/files, though honestly it pushes the boundaries about what I know about golang.

I'll try to work on that at some point soon, but if anyone is interested in helping out, adding support for hooking into the function calls would be extremely helpful

@dmattia dmattia added the help wanted Extra attention is needed label Jan 29, 2021
@crazy-matt
Copy link

crazy-matt commented Oct 12, 2022

This in your terragrunt.hcl might help:

locals {
  extra_atlantis_dependencies = [
    "../secrets.json",
  ]
}

@Almenon Almenon added the enhancement New feature or request label Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants