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

dependency is incorrectly generated for the terraform-module #507

Closed
andrey-dubnik opened this issue Jan 19, 2021 · 4 comments · Fixed by #508
Closed

dependency is incorrectly generated for the terraform-module #507

andrey-dubnik opened this issue Jan 19, 2021 · 4 comments · Fixed by #508
Labels
bug Something isn't working cdktf good first issue Good for newcomers

Comments

@andrey-dubnik
Copy link

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

cdkf 0.1.0
Java

Affected Resource(s)

terraform-module

Expected Behavior

depends_on not dependsOn in the synth JSON

Steps to Reproduce

Create any module with depends on

TerraformHclModule.Builder.create(this, "module")
            .dependsOn(List.of(rg))

References

dependsOn: this.dependsOn,

Should probably go via similar keysToSnakeCase transformation to

keysToSnakeCase(this.terraformMetaArguments),

@andrey-dubnik andrey-dubnik added the bug Something isn't working label Jan 19, 2021
@skorfmann
Copy link
Contributor

@andrey-dubnik Thanks for raising this issue. Yes, this should be snake-cased. I'm wondering if just changing the dependsOn key would be sufficient.

Out of curiosity, what's your reason to use TerraformModule rather than imports?

@skorfmann skorfmann added the good first issue Good for newcomers label Jan 19, 2021
@andrey-dubnik
Copy link
Author

Changing the property may do it as well, although this would probably cause the lack of clarity which approach to take by addressing the same problem differently within the code base.

It seem imports can only handle modules from the public hashicorp registry where we use a private one hence needed to use a different approach with the TerraformModule.

@skorfmann
Copy link
Contributor

It seem imports can only handle modules from the public hashicorp registry where we use a private one hence needed to use a different approach with the TerraformModule.

Yes, true. That's a current limitation which we'll be addressing in the future. Thanks for your feedback.

Changing the property may do it as well, although this would probably cause the lack of clarity which approach to take by addressing the same problem differently within the code base.

Absolutely. keysToSnakeCase turned out to be too greedy in some cases in the past. I'm not sure if terraformMetadata could potentially include user supplied objects which would cause the same issues again. So, that's something to double check where keysToSnakeCase is used. In this particular case, it's deviating from the other implementations already, due to the custom handling around providers.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2022

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 Dec 6, 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 good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants