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

unknown type set(string) #928

Closed
hd-deman opened this issue Aug 24, 2021 · 6 comments · Fixed by #1497
Closed

unknown type set(string) #928

hd-deman opened this issue Aug 24, 2021 · 6 comments · Fixed by #1497
Assignees
Labels
bug Something isn't working cdktf-cli confirmed independently reproduced by an engineer on the team modules priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters.
Milestone

Comments

@hd-deman
Copy link

Module generation fails if it contains variables with type = set(string).

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

terraform-cdk: 0.5.0

Debug Output

❯ cdktf get

Error: Internal Error: unknown type set(string)
    at Object.Internal (/usr/local/lib/node_modules/cdktf-cli/lib/errors.js:20:21)
    at parseType (/usr/local/lib/node_modules/cdktf-cli/lib/get/generator/module-generator.js:104:27)
    at ModuleGenerator.emitSubmodule (/usr/local/lib/node_modules/cdktf-cli/lib/get/generator/module-generator.js:38:91)
    at new ModuleGenerator (/usr/local/lib/node_modules/cdktf-cli/lib/get/generator/module-generator.js:12:18)
    at ConstructsMaker.generateTypeScript (/usr/local/lib/node_modules/cdktf-cli/lib/get/constructs-maker.js:186:13)
    at async ConstructsMaker.generate (/usr/local/lib/node_modules/cdktf-cli/lib/get/constructs-maker.js:190:9)
    at async get (/usr/local/lib/node_modules/cdktf-cli/bin/cmds/ui/get.js:50:17) {
  type: 'set(string)'
}
⠏ downloading and generating modules and providers...
Internal Error: unknown type set(string)

Expected Behavior

It should generate a module which use type set(string) in the variables.

Actual Behavior

It fails on cdktf get command.

Steps to Reproduce

Just add module with type set(string) (https://github.com/terraform-aws-modules/terraform-aws-iam/tree/master/modules/iam-assumable-role-with-oidc in this example) to cdktf.json

{
...
  "terraformModules": ["terraform-aws-modules/iam/aws//modules/[email protected]"],
...
}
@hd-deman hd-deman added bug Something isn't working new Un-triaged issue labels Aug 24, 2021
@jsteinich
Copy link
Collaborator

Caused by

const complex = /^(object|list|map)\(([\s\S]+)\)/;
not matching set and no case for it farther down.

Set is also not fully supported in general since jsii doesn't support them (aws/jsii#1). Could be worked around, possibly with ideas from #424.

@jsteinich jsteinich added confirmed independently reproduced by an engineer on the team cdktf-cli modules needs-priority Issue has not yet been prioritized; this will prompt team review and removed new Un-triaged issue labels Aug 25, 2021
@danieldreier danieldreier added priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. and removed needs-priority Issue has not yet been prioritized; this will prompt team review labels Sep 2, 2021
@danieldreier danieldreier added this to the 0.8 (in planning) milestone Sep 2, 2021
@LumaKernel
Copy link

Any workaround for this today like .addOverride()? I tried to use TerraformModule but this is abstract class.

@LumaKernel
Copy link

I can use TerraformHclModule and cdktf synth + tf init, followed by tf command itself.

@jsteinich
Copy link
Collaborator

@LumaKernel glad that you were able to find that workaround. As the issue occurs during code generation, that's really the only way currently.

Out of curiosity, why are you running tf directly after synthing?

@LumaKernel
Copy link

LumaKernel commented Nov 1, 2021

At that time I got the error and I felt the change to tf command itself solved my problem, but now I checked it and it works. ( no version up ). I don't remember was it dream or not but if I get it again, I'll write it down.
Thank you.

EDIT: Ah, it may not be solved, or I am getting new problem with cdktf without tf. But it's not relevant to this issue. Shortly cdktf deploytf apply and tf plan && tf apply are producing differently. If I can make short repro, I'll make a new issue.

@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working cdktf-cli confirmed independently reproduced by an engineer on the team modules priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants