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

Newest version doesnt take --ignore-dependency-blocks into account

Open dennislapchenko opened this issue 2 years ago • 2 comments

❯ terragrunt-atlantis-config generate --ignore-dependency-blocks
INFO[0000] Could not find an old config file. Starting from scratch
....
- autoplan:
    enabled: false
    when_modified:
    - '*.hcl'
    - '*.tf*'
    - ../../../../terragrunt.hcl
  dir: terragrunt/us-central1/stage/network/vpc
- autoplan:
    enabled: false
    when_modified:
    - '*.hcl'
    - '*.tf*'
    - ../../../../terragrunt.hcl
  dir: terragrunt/us-central1/stage/vm/bastion

All projects have links to dependencies in when_modified

> terragrunt-atlantis-config version
terragrunt-atlantis-config 1.14.2

was fine on 1.12.2 Also as a sidenote: 1.14.2 definitely generates all the projects a lot slower than previous version, is this a known change? (probably because --ignore-dependency-blocks doesnt work now :/)

Would be good to have a test for this?

dennislapchenko avatar Apr 05 '22 10:04 dennislapchenko

Can you share an example config that generates this output? This looks like the parent terragrunt.hcl is being pulled in as an implicit dependency, which is a known change introduced as part of #202. As far as speed goes, it makes sense given the increased level of introspection necessary to parse the dependency trees. Can you quantify how much slower it is for you?

henworth avatar Apr 06 '22 23:04 henworth

same issue here on latest 1.15.0

file below is the parent nonprod/terragrunt.hcl which i want to exclude from plans.

remote_state {
  backend = "s3"
  config = {
    bucket         = "redacted-${get_env("TF_VAR_account_alias", "")}-${get_env("AWS_DEFAULT_REGION", "")}-infra"
    region         = get_env("AWS_DEFAULT_REGION", "")
    key            = "state/${path_relative_to_include()}/redacted.tfstate"
    encrypt        = true
    dynamodb_table = "redacted-redacted-redacted"
  }
}

terraform {
  extra_arguments "common" {
    commands = get_terraform_commands_that_need_vars()

    arguments = [
      "-var",
      "redacted=redacted-${get_env("TF_VAR_account_alias", "")}-${get_env("AWS_DEFAULT_REGION", "")}-infra",
    ]
  }
}

locals {
  global = yamldecode(file("${find_in_parent_folders("global.yaml")}"))
}

inputs = {
  redacted            = local.global.redacted
  redacted            = local.global.redacted
  redacted = local.global.redacted
  redacted    = local.global.redacted
  redacted            = "${get_env("redacted")}/${path_relative_to_include()}"
}

file below is the child in nonprod/eu-west-1/dev/acm/terragrunt.hcl

include {
  path = find_in_parent_folders()
}

terraform {
  source = "git::[email protected]/terraform.git//acm"
}

inputs = {

  domain_name = "redacted.redacted.net"

  route53_enabled = false

}

sample from atlantis.yaml created by version 1.15: terragrunt-atlantis-config generate --ignore-dependency-blocks --ignore-parent-terragrunt true --filter aws/accounts/ --autoplan --output ./atlantis.yaml

  dir: aws/accounts/nonprod/eu-west-1/dev/acm
- autoplan:
    enabled: true
    when_modified:
    - '*.hcl'
    - '*.tf*'
    - ../../../terragrunt.hcl

sample from atlantis.yaml created by version 1.13 with same command

  dir: aws/accounts/nonprod/eu-west-1/dev/acm
- autoplan:
   enabled: true
   when_modified:
   - '*.hcl'
   - '*.tf*'

gurpalw avatar Jul 19 '22 17:07 gurpalw