Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable tobool in pulumi-converter-terraform, already implemented in pulumi-std #267

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Improvements

- Allow generating of tobool invocation.

### Bug Fixes

- Require v0.6.0 of the `terraform-provider` instead of v0.5.4 because the latter is no longer available.
- Require v0.6.0 of the `terraform-provider` instead of v0.5.4 because the latter is no longer available.
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@
"warning:builtin_functions/main.tf:940,11-949,16:Function not yet implemented:Function templatefile not yet implemented, see pulumi/pulumi-converter-terraform#192",
"warning:builtin_functions/main.tf:955,11-75:Function not yet implemented:Function textdecodebase64 not yet implemented, see pulumi/pulumi-converter-terraform#65 (catch all bug)",
"warning:builtin_functions/main.tf:961,11-54:Function not yet implemented:Function textencodebase64 not yet implemented, see pulumi/pulumi-converter-terraform#65 (catch all bug)",
"warning:builtin_functions/main.tf:1000,11-23:Function not yet implemented:Function tobool not yet implemented, see pulumi/pulumi-converter-terraform#65",
"warning:builtin_functions/main.tf:1003,11-25:Function not yet implemented:Function tobool not yet implemented, see pulumi/pulumi-converter-terraform#65",
"warning:builtin_functions/main.tf:1006,11-23:Function not yet implemented:Function tobool not yet implemented, see pulumi/pulumi-converter-terraform#65",
"warning:builtin_functions/main.tf:1009,11-23:Function not yet implemented:Function tobool not yet implemented, see pulumi/pulumi-converter-terraform#65",
"warning:builtin_functions/main.tf:1012,11-20:Function not yet implemented:Function tobool not yet implemented, see pulumi/pulumi-converter-terraform#65",
"warning:builtin_functions/main.tf:1027,11-36:Function not yet implemented:Function tomap not yet implemented, see pulumi/pulumi-converter-terraform#65 (catch all bug)",
"warning:builtin_functions/main.tf:1030,11-43:Function not yet implemented:Function tomap not yet implemented, see pulumi/pulumi-converter-terraform#65 (catch all bug)",
"warning:builtin_functions/main.tf:1036,11-22:Function not yet implemented:Function tonumber not yet implemented, see pulumi/pulumi-converter-terraform#65 (catch all bug)",
Expand Down
20 changes: 15 additions & 5 deletions pkg/convert/testdata/programs/builtin_functions/pcl/main.pp
Original file line number Diff line number Diff line change
Expand Up @@ -1377,19 +1377,29 @@

# Examples for tobool
output "funcTobool0" {
value = notImplemented("tobool(true)")
value = invoke("std:index:tobool", {
input = true
}).result
}
output "funcTobool1" {
value = notImplemented("tobool(\"true\")")
value = invoke("std:index:tobool", {
input = "true"
}).result
}
output "funcTobool2" {
value = notImplemented("tobool(null)")
value = invoke("std:index:tobool", {
input = null
}).result
}
output "funcTobool3" {
value = notImplemented("tobool(\"no\")")
value = invoke("std:index:tobool", {
input = "no"
}).result
}
output "funcTobool4" {
value = notImplemented("tobool(1)")
value = invoke("std:index:tobool", {
input = 1
}).result
}


Expand Down
6 changes: 5 additions & 1 deletion pkg/convert/tf.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,11 @@ var tfFunctionStd = map[string]struct {
inputs: []string{"input"},
output: "result",
},
"tobool": {
token: "std:index:tobool",
inputs: []string{"input"},
output: "result",
},
"transpose": {
token: "std:index:transpose",
inputs: []string{"input"},
Expand Down Expand Up @@ -3581,7 +3586,6 @@ var unimplementedFunctionBugs = map[string]string{
"regexall": "pulumi/pulumi-converter-terraform#191",
"slice": "pulumi/pulumi-converter-terraform#65",
"templatefile": "pulumi/pulumi-converter-terraform#192",
"tobool": "pulumi/pulumi-converter-terraform#65",
"toset": "pulumi/pulumi-converter-terraform#137",
"try": "pulumi/pulumi-converter-terraform#16",
"yamlencode": "pulumi/pulumi-converter-terraform#190",
Expand Down
Loading