Skip to content

Conversation

@zli82016
Copy link
Member

This change modifies the HCL writer to automatically replace any string attribute value starting with "unknown." with a Terraform variable reference (e.g. "unknown.my_var" -> var.my_var).

It also:

  • Collects all such variables used during the conversion.
  • Appends variable blocks for each unique variable to the end of the generated HCL file, with type = string.
  • Removes the usage of hcl/printer (v1) in favor of hclwrite's built-in formatting (v2), to support HCL2 syntax like type = string.

This change modifies the HCL writer to automatically replace any string
attribute value starting with "unknown." with a Terraform variable
reference (e.g. "unknown.my_var" -> var.my_var).

It also:
- Collects all such variables used during the conversion.
- Appends `variable` blocks for each unique variable to the end of the
  generated HCL file, with `type = string`.
- Removes the usage of `hcl/printer` (v1) in favor of `hclwrite`'s
  built-in formatting (v2), to support HCL2 syntax like `type = string`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant