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.
Asked
Active
Viewed 424 times
0
-
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Mar 16 '22 at 06:14
-
Are you creating those variables using `TerraformVariable`? – javierlga Jul 05 '22 at 16:30
-
Yes based on terraform variable – Amoghavarsh P Jul 06 '22 at 17:14
1 Answers
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
-
-
@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