0

Can you suggest how can i use cdktf diff to pass multiple var in cli? terraform plan -var "resourceName=testrg" -var "resourcelocation=eastus" Similar like above needed in cdktf.

1 Answers1

0

You can set them by environment variables. In this example you could do TF_VAR_resourceName=testrg TF_VAR_resourcelocatio=eastus cdktf plan.

Daniel Schmidt
  • 11,605
  • 5
  • 38
  • 70
  • Not working for me – Amoghavarsh P Mar 24 '22 at 06:09
  • @AmoghavarshP Could you maybe share a small example that shows how it's not working? That would help me a lot to identify what's going on. One thing I could see is that the variable names are not what you think they are, to double check you'd need to take a look into the cdkt.tf.json file and see which names are used for your variables. (Without the `EXCLUDE_STACK_ID_FROM_LOGICAL_IDS` feature flag set there could be a suffix added to the variable) – Daniel Schmidt Mar 30 '22 at 21:12