You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a CDKTF Construct that uses a Terraform module for some of its resources. I was going to take the same approach with the module "dependency" as the recommended approach for providers - which seems to be to reference pre-built providers as peer dependencies of the construct. Does this seem like a reasonable approach?
If this is the right approach, I was looking for the established pattern to produce pre-built modules based on existing Terraform modules. I found the project-cdktf-hybrid-construct, which seems like a first attempt, but it appears only lightly maintained - plus does not include the nice auto-upgrade feature provided by this template for providers.
As such, I was considering considering tweaking this project template to also support Terraform modules. I don't have a strong opinion on whether it is a fork of this repo vs an alternative configuration option - would take any input. The necessary change seems somewhat minor - I think I could even take it on myself and submit a PR. But before doing that work I wanted to see if people feel like this is the right direction.
I think the thing that I don't intuitively understand is where Terraform dependencies will result in conflicts - and how to avoid/manage that. For example, the pre-built library that is generated for the Terraform module will most likely depend on one or more Terraform providers. If the repo using the pre-built module library uses the same provider in a pre-built manner but that provider is built from a different Terraform provider version than the one in the pre-built module - will this be a problem?
References
No response
Help Wanted
I'm interested in contributing a fix myself
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
The text was updated successfully, but these errors were encountered:
While we currently don't have concrete plans for publishing pre-built modules ourselves, we'd probably start with duplicating this Projen template into a new repository and adjusting it to the needs for Terraform modules (which probably would mean simplifying some things and adjusting others, like e.g. the upgrade flow). Even if we currently don't have plans for pre-built modules, we'd still welcome you taking a stab at this and would be open to give feedback and be there for any questions that might pop up. But we also can't promise that we'd continue the work you start.
The dependency problem you mention is a hard one that still needs a solution 😅 However, modules don't require the provider to be present when their bindings are generated and compiled, so we could even shift that responsibility to the user. Specifying a peerDependency would probably be the best UX, but a user could still use locally generated bindings with an incompatible version 😄 So yeah, this needs some deeper thoughts.
Description
I am working on a CDKTF Construct that uses a Terraform module for some of its resources. I was going to take the same approach with the module "dependency" as the recommended approach for providers - which seems to be to reference pre-built providers as peer dependencies of the construct. Does this seem like a reasonable approach?
If this is the right approach, I was looking for the established pattern to produce pre-built modules based on existing Terraform modules. I found the project-cdktf-hybrid-construct, which seems like a first attempt, but it appears only lightly maintained - plus does not include the nice auto-upgrade feature provided by this template for providers.
As such, I was considering considering tweaking this project template to also support Terraform modules. I don't have a strong opinion on whether it is a fork of this repo vs an alternative configuration option - would take any input. The necessary change seems somewhat minor - I think I could even take it on myself and submit a PR. But before doing that work I wanted to see if people feel like this is the right direction.
I think the thing that I don't intuitively understand is where Terraform dependencies will result in conflicts - and how to avoid/manage that. For example, the pre-built library that is generated for the Terraform module will most likely depend on one or more Terraform providers. If the repo using the pre-built module library uses the same provider in a pre-built manner but that provider is built from a different Terraform provider version than the one in the pre-built module - will this be a problem?
References
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: