Skip to content

Commit

Permalink
Upgrade Terraform converter to v1.0.20 and adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guineveresaenger committed Dec 6, 2024
1 parent 2d5653b commit 97a7b57
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := true
PROJECT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))

install_plugins::
pulumi plugin install converter terraform 1.0.19
pulumi plugin install converter terraform 1.0.20
pulumi plugin install resource random 4.16.3
pulumi plugin install resource aws 6.22.2
pulumi plugin install resource archive 0.0.4
Expand Down
5 changes: 2 additions & 3 deletions dynamic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ import (
"os"
"os/exec"

"github.com/pkg/errors"
"github.com/spf13/afero"

"github.com/blang/semver"
"github.com/opentofu/opentofu/shim/run"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/pkg/v3/codegen/schema"
"github.com/pulumi/pulumi/sdk/v3/go/common/diag"
"github.com/pulumi/pulumi/sdk/v3/go/common/diag/colors"
"github.com/pulumi/pulumi/sdk/v3/go/common/resource/plugin"
"github.com/pulumi/pulumi/sdk/v3/go/common/util/contract"
"github.com/spf13/afero"

"github.com/pulumi/pulumi-terraform-bridge/dynamic/parameterize"
"github.com/pulumi/pulumi-terraform-bridge/dynamic/version"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "b2",
"version": "0.8.9",
"description": "A Pulumi provider dynamically bridged from b2.",
"attribution": "This Pulumi package is based on the [`b2` Terraform Provider](https://github.com/backblaze/terraform-provider-b2).",
"repository": "https://github.com/backblaze/terraform-provider-b2",
"publisher": "Pulumi",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
Expand All @@ -28,14 +28,14 @@
},
"nodejs": {
"packageDescription": "A Pulumi provider dynamically bridged from b2.",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/backblaze/terraform-provider-b2)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-b2` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-b2` repo](https://github.com/backblaze/terraform-provider-b2/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/backblaze/terraform-provider-b2)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e please consult the source [`terraform-provider-b2` repo](https://github.com/backblaze/terraform-provider-b2/issues).",
"compatibility": "tfbridge20",
"disableUnionOutputTypes": true,
"liftSingleValueMethodReturns": true,
"respectSchemaVersion": true
},
"python": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/backblaze/terraform-provider-b2)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-b2` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-b2` repo](https://github.com/backblaze/terraform-provider-b2/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/backblaze/terraform-provider-b2)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e please consult the source [`terraform-provider-b2` repo](https://github.com/backblaze/terraform-provider-b2/issues).",
"compatibility": "tfbridge20",
"respectSchemaVersion": true,
"pyproject": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "databricks",
"version": "1.50.0",
"description": "A Pulumi provider dynamically bridged from databricks.",
"attribution": "This Pulumi package is based on the [`databricks` Terraform Provider](https://github.com/databricks/terraform-provider-databricks).",
"repository": "https://github.com/databricks/terraform-provider-databricks",
"publisher": "Pulumi",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
Expand All @@ -28,14 +28,14 @@
},
"nodejs": {
"packageDescription": "A Pulumi provider dynamically bridged from databricks.",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/databricks/terraform-provider-databricks)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-databricks` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-databricks` repo](https://github.com/databricks/terraform-provider-databricks/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/databricks/terraform-provider-databricks)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e please consult the source [`terraform-provider-databricks` repo](https://github.com/databricks/terraform-provider-databricks/issues).",
"compatibility": "tfbridge20",
"disableUnionOutputTypes": true,
"liftSingleValueMethodReturns": true,
"respectSchemaVersion": true
},
"python": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/databricks/terraform-provider-databricks)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-databricks` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-databricks` repo](https://github.com/databricks/terraform-provider-databricks/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/databricks/terraform-provider-databricks)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e please consult the source [`terraform-provider-databricks` repo](https://github.com/databricks/terraform-provider-databricks/issues).",
"compatibility": "tfbridge20",
"respectSchemaVersion": true,
"pyproject": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "random",
"version": "3.3.0",
"description": "A Pulumi provider dynamically bridged from random.",
"attribution": "This Pulumi package is based on the [`random` Terraform Provider](https://github.com/hashicorp/terraform-provider-random).",
"repository": "https://github.com/hashicorp/terraform-provider-random",
"publisher": "Pulumi",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
Expand All @@ -28,14 +28,14 @@
},
"nodejs": {
"packageDescription": "A Pulumi provider dynamically bridged from random.",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/hashicorp/terraform-provider-random)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-random` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-random` repo](https://github.com/hashicorp/terraform-provider-random/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/hashicorp/terraform-provider-random)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e please consult the source [`terraform-provider-random` repo](https://github.com/hashicorp/terraform-provider-random/issues).",
"compatibility": "tfbridge20",
"disableUnionOutputTypes": true,
"liftSingleValueMethodReturns": true,
"respectSchemaVersion": true
},
"python": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/hashicorp/terraform-provider-random)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-random` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-random` repo](https://github.com/hashicorp/terraform-provider-random/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/hashicorp/terraform-provider-random)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e please consult the source [`terraform-provider-random` repo](https://github.com/hashicorp/terraform-provider-random/issues).",
"compatibility": "tfbridge20",
"respectSchemaVersion": true,
"pyproject": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "terraform-provider",
"displayName": "Any Terraform Provider",
"version": "v0.0.0-dev",
"description": "Use any Terraform provider with Pulumi",
"keywords": [
"category/utility"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
},
"language": {
"nodejs": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-tpsdkv2)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-tpsdkv2` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-tpsdkv2` repo](https://github.com/terraform-providers/terraform-provider-tpsdkv2/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-tpsdkv2)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e please consult the source [`terraform-provider-tpsdkv2` repo](https://github.com/terraform-providers/terraform-provider-tpsdkv2/issues).",
"compatibility": "tfbridge20",
"disableUnionOutputTypes": true
},
"python": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-tpsdkv2)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-tpsdkv2` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-tpsdkv2` repo](https://github.com/terraform-providers/terraform-provider-tpsdkv2/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-tpsdkv2)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e please consult the source [`terraform-provider-tpsdkv2` repo](https://github.com/terraform-providers/terraform-provider-tpsdkv2/issues).",
"compatibility": "tfbridge20",
"pyproject": {}
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/tf2pulumi/convert/testdata/schemas/blocks.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"name": "blocks",
"attribution": "This Pulumi package is based on the [`blocks` Terraform Provider](https://github.com/terraform-providers/terraform-provider-blocks).",
"repository": "https://github.com/pulumi/pulumi-blocks",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
},
"language": {
"nodejs": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-blocks)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-blocks` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-blocks` repo](https://github.com/terraform-providers/terraform-provider-blocks/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-blocks)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-blocks` repo](https://github.com/pulumi/pulumi-blocks/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-blocks` repo](https://github.com/terraform-providers/terraform-provider-blocks/issues).",
"compatibility": "tfbridge20",
"disableUnionOutputTypes": true
},
"python": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-blocks)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-blocks` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-blocks` repo](https://github.com/terraform-providers/terraform-provider-blocks/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-blocks)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-blocks` repo](https://github.com/pulumi/pulumi-blocks/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-blocks` repo](https://github.com/terraform-providers/terraform-provider-blocks/issues).",
"compatibility": "tfbridge20",
"pyproject": {}
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/tf2pulumi/convert/testdata/schemas/complex.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"name": "complex",
"attribution": "This Pulumi package is based on the [`complex` Terraform Provider](https://github.com/terraform-providers/terraform-provider-complex).",
"repository": "https://github.com/pulumi/pulumi-complex",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
},
"language": {
"nodejs": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-complex)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-complex` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-complex` repo](https://github.com/terraform-providers/terraform-provider-complex/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-complex)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-complex` repo](https://github.com/pulumi/pulumi-complex/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-complex` repo](https://github.com/terraform-providers/terraform-provider-complex/issues).",
"compatibility": "tfbridge20",
"disableUnionOutputTypes": true
},
"python": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-complex)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-complex` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-complex` repo](https://github.com/terraform-providers/terraform-provider-complex/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-complex)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-complex` repo](https://github.com/pulumi/pulumi-complex/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-complex` repo](https://github.com/terraform-providers/terraform-provider-complex/issues).",
"compatibility": "tfbridge20",
"pyproject": {}
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/tf2pulumi/convert/testdata/schemas/renames.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"name": "renames",
"attribution": "This Pulumi package is based on the [`renames` Terraform Provider](https://github.com/terraform-providers/terraform-provider-renames).",
"repository": "https://github.com/pulumi/pulumi-renames",
"meta": {
"moduleFormat": "(.*)(?:/[^/]*)"
},
"language": {
"nodejs": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-renames)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-renames` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-renames` repo](https://github.com/terraform-providers/terraform-provider-renames/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-renames)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-renames` repo](https://github.com/pulumi/pulumi-renames/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-renames` repo](https://github.com/terraform-providers/terraform-provider-renames/issues).",
"compatibility": "tfbridge20",
"disableUnionOutputTypes": true
},
"python": {
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-renames)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-renames` repo](/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-renames` repo](https://github.com/terraform-providers/terraform-provider-renames/issues).",
"readme": "\u003e This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-renames)\n\u003e distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature,\n\u003e first check the [`pulumi-renames` repo](https://github.com/pulumi/pulumi-renames/issues); however, if that doesn't turn up anything,\n\u003e please consult the source [`terraform-provider-renames` repo](https://github.com/terraform-providers/terraform-provider-renames/issues).",
"compatibility": "tfbridge20",
"pyproject": {}
}
Expand Down
Loading

0 comments on commit 97a7b57

Please sign in to comment.