Skip to content

Commit

Permalink
Enable JSON decode which is already in pulumi-std. (#268)
Browse files Browse the repository at this point in the history
Part of the [convert
epic](pulumi/pulumi#18346). Closes
pulumi/pulumi#18354
  • Loading branch information
brandonpollack23 authored Jan 31, 2025
1 parent f065095 commit 6c80206
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Improvements

- Allow generating of tobool invocation.
- Enable jsondecode which is already in pulumi-std

### Bug Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
"warning:builtin_functions/main.tf:457,11-76:Function not yet implemented:Function formatlist not yet implemented, see pulumi/pulumi-converter-terraform#65 (catch all bug)",
"warning:builtin_functions/main.tf:460,11-88:Function not yet implemented:Function formatlist not yet implemented, see pulumi/pulumi-converter-terraform#65 (catch all bug)",
"warning:builtin_functions/main.tf:472,11-38:Function not yet implemented:Function index not yet implemented, see pulumi/pulumi-converter-terraform#65 (catch all bug)",
"warning:builtin_functions/main.tf:490,11-47:Function not yet implemented:Function jsondecode not yet implemented, see pulumi/pulumi-converter-terraform#65",
"warning:builtin_functions/main.tf:493,11-29:Function not yet implemented:Function jsondecode not yet implemented, see pulumi/pulumi-converter-terraform#65",
"warning:builtin_functions/main.tf:505,11-32:Function not yet implemented:Function keys not yet implemented, see pulumi/pulumi-converter-terraform#65 (catch all bug)",
"warning:builtin_functions/main.tf:553,11-50:Function not yet implemented:Function lookup not yet implemented, see pulumi/pulumi-converter-terraform#65",
"warning:builtin_functions/main.tf:556,11-50:Function not yet implemented:Function lookup not yet implemented, see pulumi/pulumi-converter-terraform#65",
Expand Down
8 changes: 6 additions & 2 deletions pkg/convert/testdata/programs/builtin_functions/pcl/main.pp
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,14 @@

# Examples for jsondecode
output "funcJsondecode0" {
value = notImplemented("jsondecode(\"{\\\"hello\\\": \\\"world\\\"}\")")
value = invoke("std:index:jsondecode", {
input = "{\"hello\": \"world\"}"
}).result
}
output "funcJsondecode1" {
value = notImplemented("jsondecode(\"true\")")
value = invoke("std:index:jsondecode", {
input = "true"
}).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 @@ -592,6 +592,11 @@ var tfFunctionStd = map[string]struct {
inputs: []string{"separator", "input"},
output: "result",
},
"jsondecode": {
token: "std:index:jsondecode",
inputs: []string{"input"},
output: "result",
},
"log": {
token: "std:index:log",
inputs: []string{"base", "input"},
Expand Down Expand Up @@ -3580,7 +3585,6 @@ var unimplementedFunctionBugs = map[string]string{
"flatten": "pulumi/pulumi-converter-terraform#138",
"format": "pulumi/pulumi-converter-terraform#65",
"formatdate": "pulumi/pulumi-converter-terraform#196",
"jsondecode": "pulumi/pulumi-converter-terraform#65",
"lookup": "pulumi/pulumi-converter-terraform#65",
"merge": "pulumi/pulumi-converter-terraform#65",
"regexall": "pulumi/pulumi-converter-terraform#191",
Expand Down

0 comments on commit 6c80206

Please sign in to comment.