Skip to content

Commit

Permalink
Fix dynamic bridge clobbering non-string ID props (#2828)
Browse files Browse the repository at this point in the history
  • Loading branch information
VenelinMartinov authored Jan 13, 2025
1 parent 27c2419 commit 2a95c03
Show file tree
Hide file tree
Showing 3 changed files with 3,901 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dynamic/internal/fixup/properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ func fixID(providerName string, tokenPrefix string) fixupProperty {
// If either id.Optional or id.Required are set, then the provider allows
// (or requires) the user to set "id" as an input. Pulumi does not allow
// that, so we alias "id".
if !tfIDProperty.Optional() && !tfIDProperty.Required() {
// Alternatively if the type of id is not string, we'll replace the property
// so we need to alias the original property.
if !tfIDProperty.Optional() && !tfIDProperty.Required() && tfIDProperty.Type() == shim.TypeString {
return nil
}

Expand Down
1 change: 1 addition & 0 deletions dynamic/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ func TestSchemaGeneration(t *testing.T) { //nolint:paralleltest
// testSchema("Azure/alz", "0.11.1")
testSchema("Backblaze/b2", "0.8.9")
testSchema("databricks/databricks", "1.50.0")
testSchema("BunnyWay/bunnynet", "0.5.1")
}

func TestSchemaGenerationFullDocs(t *testing.T) { //nolint:paralleltest
Expand Down
Loading

0 comments on commit 2a95c03

Please sign in to comment.