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
The process of writing the providers.tf.json file is a bit brittle.
The Terraform version constraint is written on cdktf get
The actual provider config is merged on cdktf synth
This breaks, when a user removes the synthesize target folder (e.g. dist). On the next synth, the provider config is still written, but the version constraints are lost.
On the other hand, when doing another cdktf get, the providers.tf.json is overwritten and leaves the dist folder in an invalid state. In order to run a cdktf get successfully, the dist folder has to be deleted.
Write some kind of lock file for exact provider and module versions in project root directory
Generate version constraints on synth from that lock file.
This would make sure, that the provider / module classes are always matching the source they were generated from. An upgrade would be an explicit run of cdktf get, which would regenerated the lock file.
Go with the approach described in #43 and make each resource (including providers) aware of the version they were generated from. Use this version information to generate the correct Terraform provider version constraints.
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.
The process of writing the
providers.tf.json
file is a bit brittle.cdktf get
cdktf synth
This breaks, when a user removes the synthesize target folder (e.g.
dist
). On the next synth, the provider config is still written, but the version constraints are lost.On the other hand, when doing another
cdktf get
, theproviders.tf.json
is overwritten and leaves thedist
folder in an invalid state. In order to run acdktf get
successfully, thedist
folder has to be deleted.Example
Possible Solution 1:
cdktf get
in a temporary folderThis would make sure, that the provider / module classes are always matching the source they were generated from. An upgrade would be an explicit run of
cdktf get
, which would regenerated the lock file.Example
Given the following
cdktf.json
file:This could generated the following
cdktf.lock
filePossible Solution 2:
Go with the approach described in #43 and make each resource (including providers) aware of the version they were generated from. Use this version information to generate the correct Terraform provider version constraints.
References
This is loosely related to #43
The text was updated successfully, but these errors were encountered: