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

fix: add required_version to json schema #2355

Conversation

michaellzc
Copy link
Contributor

@michaellzc michaellzc commented Nov 26, 2022

Context

8b069eb added validation on the cdk.tf.json file. However, the schema is missing required_version in the terraform block

hence when running cdktf [deploy|plan|destroy] will result in the following error

0 Stacks deploying     0 Stacks done     0 Stacks waiting
1 validation issue(s)

  Issue #0: unrecognized_keys at terraform
  Unrecognized key(s) in object: 'required_version'

Note

There is another terraform json schema at https://sourcegraph.com/github.com/daniel-laszlo/terraform-cdk/-/blob/packages/@cdktf/hcl2cdk/lib/schema.ts?L22

I do not have any historical context on this project, but should there only be one?

Another note

required_version is not supported by cdktf natively yet (at least last time I check), we currently use the escape hatch in an aspect to add required_version in every stack

@michaellzc michaellzc requested a review from a team as a code owner November 26, 2022 03:57
@michaellzc michaellzc requested review from DanielMSchmidt and Maed223 and removed request for a team November 26, 2022 03:57
@hashicorp-cla
Copy link

hashicorp-cla commented Nov 26, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@DanielMSchmidt DanielMSchmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for the help! I though I had everything covered in .nonstrict(), but I missed that one 🙈

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

I'm going to lock this pull request 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 related to this change, 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 Jan 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants