* hcl2template: err on malformed local/data dep
When introducing the DAG for locals and datasources, we forgot to handle
one limit case: if a dependency for a local or data is malformed, we
didn't check that a vertex was associated to it, leading to the final
DAG being malformed, and the DAG library would crash in this case.
This commit fixes this problem by checking that the dependency does
exist before attempting to add it to the graph as an edge for a vertex,
so that it is reported accurately, and do that Packer doesn't crash.
* error message change
---------
Co-authored-by: anshul sharma <anshul.sharma@hashicorp.com>
* formatting multiple hcl files
* recursive formating
* test case fixing
* test case fix
* removed not required code
* existing test code fix
* go formatting
* more test cases for new cases
* doc changes
* added additional check on error message in negative test case
* WIP Testing Approach
* WIP Testing Approach
* WIP Testing Approach Work
* WIP Testing Approach
* adding acceptance test for windows Amazon EBS.
* modify wrapper string to use Set-Variable
* fixing unit tests
* cleanup
* updated approach to use -file instead of inline powershell execution.
* adding more scenarios for acceptance test.
* using writeString for file directly.
* changing variable name
* updating test case. cleanup.
* updating test case
* updating test case
* updating test case - nested try catch
* adding unit test for None Execution Policy
* adding unit test for None Execution Policy
* fix test case
Previous version was v0.33.0, which was detected vulnerable to
GO-2025-3503.
This is unlikely to be a bug that causes significant security concerns,
but we fix that with this commit regardless.
* modifying the for loop to preserver user inputted variable files preference
* adding test cases
* pr comments + refactoring the for loop for better readability.
* pr comments + refactoring the for loop for better readability.
* pr comments | handling default case
* adding additional test case
* fixing test cases
* fixing test cases. creating a subdirectory to add a test case for both hcl and json auto var files
* adding test case for json auto var file
This commit adds 3 new HCL2 functions:
* `sum`: computes the sum of a collection of numerical values
* `startswith`: checks if a string has another as prefix
* `endswith`: checks if a string has another as suffix