terraform-cdk
terraform-cdk copied to clipboard
Unknown type tuple
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
cdktf & Language Versions
Typescript

Affected Resource(s)
- cdktf.json

- module "environment" variables.tf

Debug Output

Expected Behavior
When using modules we should be able to use "typle" type for input variables.
Actual Behavior
Module generation fails when tuple type is used.
Steps to Reproduce
Important Factoids
References
- #0000
Need to update https://github.com/hashicorp/terraform-cdk/blob/8263964d3535c913ddab2770d3a7ecc61f53fa1e/packages/%40cdktf/provider-generator/lib/get/generator/module-generator.ts#L133 to have support for tuples.
@jsteinich I want to solve this issue. I am new to community. Can you please help me ?
@aayushharwani-aidash Happy to have your help.
My previous comment links to the section of code that needs to be modified. Need to make sure tuple is included in the check and that a case is created to handle it.
https://github.com/hashicorp/terraform-cdk/blob/main/packages/@cdktf/provider-generator/lib/get/tests/generator/module-generator.test.ts would be a good place to add some test cases for the new type. You can basically just make a regular hcl file that contains variables of different tuple types and confirm that they work with test cases.
@jsteinich @xiehan depend on code, seems object, list, set, map is being handled inside. So for this update, is it mean that type tuple also needs to be handled. Is my understanding correct?
@jsteinich could you check the following? https://github.com/hashicorp/terraform-cdk/pull/2964
Seems it changes as
list(tuple([string, string, number])) => tuple[string,string,number][]
If it seems okay, I'll include several test cases 👍
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.