From 878ed1d68a282da4e9d8ab17978d0c91423f7d24 Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Wed, 7 Dec 2022 14:59:30 +0000 Subject: [PATCH] Add a test for count --- pkg/tf2pulumi/convert/testdata/count/main.tf | 13 +++++++++++++ pkg/tf2pulumi/convert/testdata/count/pcl/main.pp | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 pkg/tf2pulumi/convert/testdata/count/main.tf create mode 100644 pkg/tf2pulumi/convert/testdata/count/pcl/main.pp diff --git a/pkg/tf2pulumi/convert/testdata/count/main.tf b/pkg/tf2pulumi/convert/testdata/count/main.tf new file mode 100644 index 000000000..f647c5ec5 --- /dev/null +++ b/pkg/tf2pulumi/convert/testdata/count/main.tf @@ -0,0 +1,13 @@ +resource "simple_resource" "a_resource_with_count" { + count = 4 + input_one = "Hello ${count.index}" + input_two = true +} + +output "some_output_a" { + value = simple_resource.a_resource_with_count[0].result +} + +output "some_output_b" { + value = simple_resource.a_resource_with_count[1].result +} \ No newline at end of file diff --git a/pkg/tf2pulumi/convert/testdata/count/pcl/main.pp b/pkg/tf2pulumi/convert/testdata/count/pcl/main.pp new file mode 100644 index 000000000..69f0a8098 --- /dev/null +++ b/pkg/tf2pulumi/convert/testdata/count/pcl/main.pp @@ -0,0 +1,14 @@ +resource aResourceWithCount "simple:index:resource" { +options { + range = 4 + +} + input_one = "Hello ${range.value}" + input_two = true +} +output someOutputA { + value = aResourceWithCount[0].result +} +output someOutputB { + value = aResourceWithCount[1].result +} \ No newline at end of file