Repository: pulumi/pulumi-terraform-bridge
Pull request #1194 (2023-06-05 22:49:02)

Update pulumi pkg/sdk

github-actions[bot]: Diff for [pulumi-azuread](https://github.com/pulumi-bot/pulumi-azuread/compare/d85febd..ded94c6) with merge commit 6b6995dbbebaf146a8656b2a7d54285649707858
github-actions[bot]: Diff for [pulumi-random](https://github.com/pulumi-bot/pulumi-random/compare/de3fdc4..a158bc0) with merge commit 6d7089d66d195da4f35b61a63b0b2af795806bac
github-actions[bot]: Diff for [pulumi-random](https://github.com/pulumi-bot/pulumi-random/compare/deb2b53..151c597) with merge commit 6b6995dbbebaf146a8656b2a7d54285649707858
github-actions[bot]: Diff for [pulumi-azuread](https://github.com/pulumi-bot/pulumi-azuread/compare/d5760d7..04d03ca) with merge commit 6d7089d66d195da4f35b61a63b0b2af795806bac

Patch:
diff --git a/go.mod b/go.mod
index 583cfd46..f96f3115 100644
--- a/go.mod
+++ b/go.mod
@@ -206,8 +206,8 @@ require (
 	github.com/pkg/term v1.1.0 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/posener/complete v1.2.3 // indirect
-	github.com/pulumi/pulumi/pkg/v3 v3.69.0
-	github.com/pulumi/pulumi/sdk/v3 v3.69.0
+	github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14
+	github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14
 	github.com/rivo/uniseg v0.4.4 // indirect
 	github.com/rogpeppe/go-internal v1.9.0 // indirect
 	github.com/ryanuber/go-glob v1.0.0 // indirect
diff --git a/go.sum b/go.sum
index 3bc9640b..3cc01907 100644
--- a/go.sum
+++ b/go.sum
@@ -1677,10 +1677,10 @@ github.com/pulumi/pulumi-java/pkg v0.9.2 h1:fpBwf1NHf3j5YuigOWsXPvJCAFivEp1D6aOl
 github.com/pulumi/pulumi-java/pkg v0.9.2/go.mod h1:+5V4jggi3063hksi28zYvLm42UWVg3VqpR6qGZraIdM=
 github.com/pulumi/pulumi-yaml v1.1.1 h1:8pyBNIU8+ym0wYpjhsCqN+cutygfK1XbhY2YEeNfyXY=
 github.com/pulumi/pulumi-yaml v1.1.1/go.mod h1:GhpdS6rFpwqvUtKdA+fQy8P28iNvncng39IXh5q68vE=
-github.com/pulumi/pulumi/pkg/v3 v3.69.0 h1:IP9WCBFYRXWzbEFNsSquBoHKF5ux32XImKpRdju8HjU=
-github.com/pulumi/pulumi/pkg/v3 v3.69.0/go.mod h1:GbsJqE2bGotPY+mj07LKlpps9ZzAlV7qRQ/u77kw9yk=
-github.com/pulumi/pulumi/sdk/v3 v3.69.0 h1:WENc7menQMT10I34kVg1ZatQTMlifovuZ9i8CcTrk7A=
-github.com/pulumi/pulumi/sdk/v3 v3.69.0/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ=
+github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14 h1:OzG9JeGVoxdkXl8erupEs5Vr0C7QG0Cj4edD+52FquA=
+github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14/go.mod h1:HKj92R5+QguCaJzxXYJuc/tRT299T1PIw6bispOgW40=
+github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14 h1:kK0NPOmuanmn1OZsHWmglNKcYEyccdYrWhxH9V/K3KU=
+github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ=
 github.com/pulumi/schema-tools v0.1.2 h1:Fd9xvUjgck4NA+7/jSk7InqCUT4Kj940+EcnbQKpfZo=
 github.com/pulumi/schema-tools v0.1.2/go.mod h1:62lgj52Tzq11eqWTIaKd+EVyYAu5dEcDJxMhTjvMO/k=
 github.com/pulumi/terraform v0.12.1-0.20230322133416-a268cd0892c9 h1:VHeasqoSdMgpxw8Rx46TybHixfnBlCk0i0JLDusNn4Y=
diff --git a/pf/go.mod b/pf/go.mod
index 30808cde..32ff1c07 100644
--- a/pf/go.mod
+++ b/pf/go.mod
@@ -189,8 +189,8 @@ require (
 	github.com/posener/complete v1.2.3 // indirect
 	github.com/pulumi/pulumi-java/pkg v0.9.2 // indirect
 	github.com/pulumi/pulumi-yaml v1.1.1 // indirect
-	github.com/pulumi/pulumi/pkg/v3 v3.69.0
-	github.com/pulumi/pulumi/sdk/v3 v3.69.0
+	github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14
+	github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14
 	github.com/pulumi/schema-tools v0.1.2 // indirect
 	github.com/rivo/uniseg v0.4.4 // indirect
 	github.com/rogpeppe/go-internal v1.9.0 // indirect
diff --git a/pf/go.sum b/pf/go.sum
index d49797c9..14fe6b91 100644
--- a/pf/go.sum
+++ b/pf/go.sum
@@ -1636,10 +1636,10 @@ github.com/pulumi/pulumi-java/pkg v0.9.2/go.mod h1:+5V4jggi3063hksi28zYvLm42UWVg
 github.com/pulumi/pulumi-terraform-bridge/testing v0.0.1 h1:SCg1gjfY9N4yn8U8peIUYATifjoDABkyR7H9lmefsfc=
 github.com/pulumi/pulumi-yaml v1.1.1 h1:8pyBNIU8+ym0wYpjhsCqN+cutygfK1XbhY2YEeNfyXY=
 github.com/pulumi/pulumi-yaml v1.1.1/go.mod h1:GhpdS6rFpwqvUtKdA+fQy8P28iNvncng39IXh5q68vE=
-github.com/pulumi/pulumi/pkg/v3 v3.69.0 h1:IP9WCBFYRXWzbEFNsSquBoHKF5ux32XImKpRdju8HjU=
-github.com/pulumi/pulumi/pkg/v3 v3.69.0/go.mod h1:GbsJqE2bGotPY+mj07LKlpps9ZzAlV7qRQ/u77kw9yk=
-github.com/pulumi/pulumi/sdk/v3 v3.69.0 h1:WENc7menQMT10I34kVg1ZatQTMlifovuZ9i8CcTrk7A=
-github.com/pulumi/pulumi/sdk/v3 v3.69.0/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ=
+github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14 h1:OzG9JeGVoxdkXl8erupEs5Vr0C7QG0Cj4edD+52FquA=
+github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14/go.mod h1:HKj92R5+QguCaJzxXYJuc/tRT299T1PIw6bispOgW40=
+github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14 h1:kK0NPOmuanmn1OZsHWmglNKcYEyccdYrWhxH9V/K3KU=
+github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ=
 github.com/pulumi/schema-tools v0.1.2 h1:Fd9xvUjgck4NA+7/jSk7InqCUT4Kj940+EcnbQKpfZo=
 github.com/pulumi/schema-tools v0.1.2/go.mod h1:62lgj52Tzq11eqWTIaKd+EVyYAu5dEcDJxMhTjvMO/k=
 github.com/pulumi/terraform v0.12.1-0.20230322133416-a268cd0892c9 h1:VHeasqoSdMgpxw8Rx46TybHixfnBlCk0i0JLDusNn4Y=
diff --git a/pkg/tf2pulumi/convert/tf.go b/pkg/tf2pulumi/convert/tf.go
index 93a4d505..e07bc7ec 100644
--- a/pkg/tf2pulumi/convert/tf.go
+++ b/pkg/tf2pulumi/convert/tf.go
@@ -2751,9 +2751,11 @@ func translateModuleSourceCode(
 							},
 						}
 					}
+					// Maintain the subdir from the original module call.
+					remoteAddr.Subdir = addr.Subdir
 
 					destinationPath := filepath.Join(destinationDirectory,
-						fmt.Sprintf("%s_%s", addr.Package.Name, latestVersion))
+						fmt.Sprintf("%s_%s", addr.Package.Name, latestVersion), addr.Subdir)
 					// Check that this path isn't already taken
 					for _, path := range modules {
 						if path == destinationPath {
diff --git a/pkg/tf2pulumi/il/plugin_info.go b/pkg/tf2pulumi/il/plugin_info.go
index f507fd95..0ba6357d 100644
--- a/pkg/tf2pulumi/il/plugin_info.go
+++ b/pkg/tf2pulumi/il/plugin_info.go
@@ -15,6 +15,7 @@
 package il
 
 import (
+	"context"
 	"encoding/json"
 	"fmt"
 	"net/http"
@@ -50,7 +51,8 @@ func NewMapperProviderInfoSource(mapper convert.Mapper) ProviderInfoSource {
 func (mapper *mapperProviderInfoSource) GetProviderInfo(
 	registryName, namespace, name, version string) (*tfbridge.ProviderInfo, error) {
 
-	data, err := mapper.mapper.GetMapping(name, GetPulumiProviderName(name))
+	// TODO: Mapper has been made context aware, but ProviderInfoSource isn't.
+	data, err := mapper.mapper.GetMapping(context.TODO(), name, GetPulumiProviderName(name))
 	if err != nil {
 		return nil, err
 	}


Test patch:
diff --git a/internal/testing/mappings.go b/internal/testing/mappings.go
index c47e72d9..a3467907 100644
--- a/internal/testing/mappings.go
+++ b/internal/testing/mappings.go
@@ -15,6 +15,7 @@
 package testing
 
 import (
+	"context"
 	"errors"
 	"fmt"
 	"os"
@@ -25,7 +26,7 @@ type TestFileMapper struct {
 	Path string
 }
 
-func (l *TestFileMapper) GetMapping(provider string, pulumiProvider string) ([]byte, error) {
+func (l *TestFileMapper) GetMapping(ctx context.Context, provider string, pulumiProvider string) ([]byte, error) {
 	if pulumiProvider == "" {
 		pulumiProvider = provider
 	}
diff --git a/pf/tests/go.mod b/pf/tests/go.mod
index 20aa2726..c3f81bcd 100644
--- a/pf/tests/go.mod
+++ b/pf/tests/go.mod
@@ -205,8 +205,8 @@ require (
 	github.com/pulumi/pulumi-java/pkg v0.9.2 // indirect
 	github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4 // indirect
 	github.com/pulumi/pulumi-yaml v1.1.1 // indirect
-	github.com/pulumi/pulumi/pkg/v3 v3.69.0
-	github.com/pulumi/pulumi/sdk/v3 v3.69.0
+	github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14
+	github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14
 	github.com/pulumi/schema-tools v0.1.2 // indirect
 	github.com/rivo/uniseg v0.4.4 // indirect
 	github.com/rogpeppe/go-internal v1.9.0 // indirect
diff --git a/pf/tests/go.sum b/pf/tests/go.sum
index 4b7baa87..fe1023e1 100644
--- a/pf/tests/go.sum
+++ b/pf/tests/go.sum
@@ -1692,10 +1692,10 @@ github.com/pulumi/pulumi-java/pkg v0.9.2 h1:fpBwf1NHf3j5YuigOWsXPvJCAFivEp1D6aOl
 github.com/pulumi/pulumi-java/pkg v0.9.2/go.mod h1:+5V4jggi3063hksi28zYvLm42UWVg3VqpR6qGZraIdM=
 github.com/pulumi/pulumi-yaml v1.1.1 h1:8pyBNIU8+ym0wYpjhsCqN+cutygfK1XbhY2YEeNfyXY=
 github.com/pulumi/pulumi-yaml v1.1.1/go.mod h1:GhpdS6rFpwqvUtKdA+fQy8P28iNvncng39IXh5q68vE=
-github.com/pulumi/pulumi/pkg/v3 v3.69.0 h1:IP9WCBFYRXWzbEFNsSquBoHKF5ux32XImKpRdju8HjU=
-github.com/pulumi/pulumi/pkg/v3 v3.69.0/go.mod h1:GbsJqE2bGotPY+mj07LKlpps9ZzAlV7qRQ/u77kw9yk=
-github.com/pulumi/pulumi/sdk/v3 v3.69.0 h1:WENc7menQMT10I34kVg1ZatQTMlifovuZ9i8CcTrk7A=
-github.com/pulumi/pulumi/sdk/v3 v3.69.0/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ=
+github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14 h1:OzG9JeGVoxdkXl8erupEs5Vr0C7QG0Cj4edD+52FquA=
+github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14/go.mod h1:HKj92R5+QguCaJzxXYJuc/tRT299T1PIw6bispOgW40=
+github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14 h1:kK0NPOmuanmn1OZsHWmglNKcYEyccdYrWhxH9V/K3KU=
+github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ=
 github.com/pulumi/schema-tools v0.1.2 h1:Fd9xvUjgck4NA+7/jSk7InqCUT4Kj940+EcnbQKpfZo=
 github.com/pulumi/schema-tools v0.1.2/go.mod h1:62lgj52Tzq11eqWTIaKd+EVyYAu5dEcDJxMhTjvMO/k=
 github.com/pulumi/terraform v1.4.0 h1:AqK+sODtmmogkVypm5zJB6M3c9NprC1qAur+rNuRKcY=
diff --git a/pkg/tests/go.mod b/pkg/tests/go.mod
index 8a6821db..49bc123c 100644
--- a/pkg/tests/go.mod
+++ b/pkg/tests/go.mod
@@ -162,8 +162,8 @@ require (
 	github.com/pkg/term v1.1.0 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/pulumi/pulumi-terraform-bridge/x/muxer v0.0.4 // indirect
-	github.com/pulumi/pulumi/pkg/v3 v3.69.0
-	github.com/pulumi/pulumi/sdk/v3 v3.69.0 // indirect
+	github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14
+	github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14 // indirect
 	github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e // indirect
 	github.com/rivo/uniseg v0.4.4 // indirect
 	github.com/rogpeppe/go-internal v1.9.0 // indirect
diff --git a/pkg/tests/go.sum b/pkg/tests/go.sum
index 4ed043f8..8e86f322 100644
--- a/pkg/tests/go.sum
+++ b/pkg/tests/go.sum
@@ -1517,10 +1517,10 @@ github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1
 github.com/prometheus/prometheus v0.35.0/go.mod h1:7HaLx5kEPKJ0GDgbODG0fZgXbQ8K/XjZNJXQmbmgQlY=
 github.com/prometheus/prometheus v0.37.0/go.mod h1:egARUgz+K93zwqsVIAneFlLZefyGOON44WyAp4Xqbbk=
 github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
-github.com/pulumi/pulumi/pkg/v3 v3.69.0 h1:IP9WCBFYRXWzbEFNsSquBoHKF5ux32XImKpRdju8HjU=
-github.com/pulumi/pulumi/pkg/v3 v3.69.0/go.mod h1:GbsJqE2bGotPY+mj07LKlpps9ZzAlV7qRQ/u77kw9yk=
-github.com/pulumi/pulumi/sdk/v3 v3.69.0 h1:WENc7menQMT10I34kVg1ZatQTMlifovuZ9i8CcTrk7A=
-github.com/pulumi/pulumi/sdk/v3 v3.69.0/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ=
+github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14 h1:OzG9JeGVoxdkXl8erupEs5Vr0C7QG0Cj4edD+52FquA=
+github.com/pulumi/pulumi/pkg/v3 v3.69.1-0.20230605220215-9df9a4a8bd14/go.mod h1:HKj92R5+QguCaJzxXYJuc/tRT299T1PIw6bispOgW40=
+github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14 h1:kK0NPOmuanmn1OZsHWmglNKcYEyccdYrWhxH9V/K3KU=
+github.com/pulumi/pulumi/sdk/v3 v3.69.1-0.20230605220215-9df9a4a8bd14/go.mod h1:BUUBfQZsH0FPuznRfFHkR+b96VlXELnn+DgidFj4XSQ=
 github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e h1:Dik4Qe/+xguB8JagPyXNlbOnRiXGmq/PSPQTGunYnTk=
 github.com/pulumi/terraform-diff-reader v0.0.0-20201211191010-ad4715e9285e/go.mod h1:sZ9FUzGO+yM41hsQHs/yIcj/Y993qMdBxBU5mpDmAfQ=
 github.com/pulumi/terraform-plugin-sdk/v2 v2.0.0-20220725190814-23001ad6ec03 h1:J06u+TRoOQ9C6JZlXNvmOE5Il4/WdXslx5bOUIRZtDI=
@@ -1572,8 +1572,8 @@ github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX
 github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
 github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
 github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
-github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
 github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
+github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
 github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
 github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
 github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=