Skip to content

Commit 2a95c03

Browse files
Fix dynamic bridge clobbering non-string ID props (#2828)
1 parent 27c2419 commit 2a95c03

File tree

3 files changed

+3901
-1
lines changed

3 files changed

+3901
-1
lines changed

dynamic/internal/fixup/properties.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ func fixID(providerName string, tokenPrefix string) fixupProperty {
185185
// If either id.Optional or id.Required are set, then the provider allows
186186
// (or requires) the user to set "id" as an input. Pulumi does not allow
187187
// that, so we alias "id".
188-
if !tfIDProperty.Optional() && !tfIDProperty.Required() {
188+
// Alternatively if the type of id is not string, we'll replace the property
189+
// so we need to alias the original property.
190+
if !tfIDProperty.Optional() && !tfIDProperty.Required() && tfIDProperty.Type() == shim.TypeString {
189191
return nil
190192
}
191193

dynamic/provider_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ func TestSchemaGeneration(t *testing.T) { //nolint:paralleltest
454454
// testSchema("Azure/alz", "0.11.1")
455455
testSchema("Backblaze/b2", "0.8.9")
456456
testSchema("databricks/databricks", "1.50.0")
457+
testSchema("BunnyWay/bunnynet", "0.5.1")
457458
}
458459

459460
func TestSchemaGenerationFullDocs(t *testing.T) { //nolint:paralleltest

0 commit comments

Comments
 (0)