diff --git a/pkg/tf2pulumi/convert/testdata/expressions/main.tf b/pkg/tf2pulumi/convert/testdata/expressions/main.tf new file mode 100644 index 000000000..091fdc243 --- /dev/null +++ b/pkg/tf2pulumi/convert/testdata/expressions/main.tf @@ -0,0 +1,70 @@ +output "null_out" { + value = null +} + +output "number_out" { + value = 0 +} + +output "bool_out" { + value = true +} + +output "string_out" { + value = "hello world" +} + +output "tuple_out" { + value = [1, 2, 3] +} + +output "str_object_out" { + value = { + hello: "hallo" + goodbye: "ha det" + } +} + +locals { + a_key = "hello" + a_value = -1 +} + +output "complex_object_out" { + value = { + a_tuple: ["a", "b", "c"] + an_object: { + literal_key: 1 + another_literal_key = 2 + "yet_another_literal_key": local.a_value + # This doesn't translate correctly + # (local.a_key) = 4 + } + ambiguous_for: { + "for" = 1 + } + } +} + +output "quoted_template" { + value = "The key is ${local.a_key}" +} + +output "heredoc" { + value = < "${value}:${local.a_value}" if key != 0} +} \ No newline at end of file diff --git a/pkg/tf2pulumi/convert/testdata/expressions/pcl/main.pp b/pkg/tf2pulumi/convert/testdata/expressions/pcl/main.pp new file mode 100644 index 000000000..eb60ef0fa --- /dev/null +++ b/pkg/tf2pulumi/convert/testdata/expressions/pcl/main.pp @@ -0,0 +1,56 @@ +output nullOut { + value = null +} +output numberOut { + value = 0 +} +output boolOut { + value = true +} +output stringOut { + value = "hello world" +} +output tupleOut { + value = [1, 2, 3] +} +output strObjectOut { + value = { + hello: "hallo" + goodbye: "ha det" + } +} + aKey = "hello" + aValue = -1 +output complexObjectOut { + value = { + a_tuple: ["a", "b", "c"] + an_object: { + literal_key: 1 + another_literal_key = 2 + "yet_another_literal_key": aValue + # This doesn't translate correctly + # (local.a_key) = 4 + } + ambiguous_for: { + "for" = 1 + } + } +} +output quotedTemplate { + value = "The key is ${aKey}" +} +output heredoc { + value = < "${value}:${aValue}" if key != 0} +} \ No newline at end of file