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

Input dependency value with if statement #88

Open
badsector3 opened this issue Jul 29, 2023 · 0 comments
Open

Input dependency value with if statement #88

badsector3 opened this issue Jul 29, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@badsector3
Copy link

badsector3 commented Jul 29, 2023

I checked documentation but cannot find answer.

Is it possible to pass conditional dependency?

dependency "eks" {
  config_path = "${dirname(find_in_parent_folders("env.hcl"))}/eks"

  mock_outputs = {
    cluster_arn  = "temporary-cluster-arn"
    cluster_id   = "temporary-cluster-id"
    cluster_name = "temporary-cluster-name"
  }
}

inputs = {
  cluster_name   = "${dependency.eks.outputs.cluster_name}" == "temporary-cluster-name" : "${dependency.eks.outputs.cluster_id}" ? "${dependency.eks.outputs.cluster_name}"
}

Getting Error:

Missing attribute separator; Expected a newline or comma to mark the beginning of the next attribute.
ERRO[0000] Unable to determine underlying exit code, so Terragrunt will exit with error code 1

The idea is to pass cluster_id if cluster_name is not returned.
There is a new version of module where cluster_id is replaced with cluster_name.
I have multiple env. running and cannot change yet all in one go. Looking for solution.

@badsector3 badsector3 added the enhancement New feature or request label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant