Skip to content

Commit

Permalink
Add dynamic index test (#701)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frassle committed Dec 16, 2022
1 parent e62b7f9 commit a09b153
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/tf2pulumi/convert/testdata/expressions/main.tf
Expand Up @@ -31,10 +31,14 @@ locals {
a_list = [1, 2, 3]
}

output "index_out" {
output "static_index_out" {
value = local.a_list[1]
}

output "dynamic_index_out" {
value = local.a_list[local.a_value]
}

output "complex_object_out" {
value = {
a_tuple: ["a", "b", "c"]
Expand Down
5 changes: 4 additions & 1 deletion pkg/tf2pulumi/convert/testdata/expressions/pcl/main.pp
Expand Up @@ -22,9 +22,12 @@
aKey = "hello"
aValue = -1
aList = [1, 2, 3]
output indexOut {
output staticIndexOut {
value = aList[1]
}
output dynamicIndexOut {
value = aList[aValue]
}
output complexObjectOut {
value = {
a_tuple: ["a", "b", "c"]
Expand Down

0 comments on commit a09b153

Please sign in to comment.