Skip to content

Commit eb234ea

Browse files
authoredMar 19, 2025··
Remove remove-ephemeral-resources.patch (#5339)
This pull request combines new bridge functionality and an attribute traversal to automate omitting any of the kind of write-only and write-only-adjacent resources that a patch addressed previously. While there's a bit of metadata tracking cruft due to the attribute traversal wanting build-time information, the schema itself has no changes. Fixes #5231. - **Remove Remove-ephemeral-resources.patch and reformat patches** - **Traverse properties and filter write-only supporting ones, then Omit them** - **Using bridge-supported traversal implies some metadata tracking**
1 parent 0d2dc2f commit eb234ea

9 files changed

+22
-1004
lines changed
 

‎patches/0085-Remove-ephemeral-resources.patch

-1,002
This file was deleted.
File renamed without changes.

‎provider/cmd/pulumi-resource-aws/bridge-metadata.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -280952,5 +280952,6 @@
280952280952
"aws:workspaces/getImage:getImage": 0,
280953280953
"aws:workspaces/getWorkspace:getWorkspace": 0
280954280954
}
280955-
}
280955+
},
280956+
"write-only-supporting-properties": {}
280956280957
}

‎provider/cmd/pulumi-resource-aws/runtime-bridge-metadata.json

+1-1
Large diffs are not rendered by default.

‎provider/resources.go

+19
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"context"
1919
_ "embed"
2020
"fmt"
21+
"github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/walk"
2122
"log"
2223
"os"
2324
"path/filepath"
@@ -5718,6 +5719,24 @@ compatibility shim in favor of the new "name" field.`)
57185719
args.ExamplePath == "#/resources/aws:appsync/graphQLApi:GraphQLApi"
57195720
}
57205721

5722+
// TODO[pulumi/pulumi-terraform-bridge#2938]
5723+
// Currently, the bridge omits write-only attributes from being written to a provider schema.
5724+
// In this provider, we additionally have some attributes called things like "has_value_wo" or "version_wo".
5725+
// To avoid user confusion, we omit these here as well.
5726+
tfbridge.MustTraverseProperties(&prov, "write-only-supporting-properties",
5727+
func(propertyVisitInfo tfbridge.PropertyVisitInfo) (tfbridge.PropertyVisitResult, error) {
5728+
schemaPath := propertyVisitInfo.SchemaPath()
5729+
if key, ok := schemaPath[len(schemaPath)-1].(walk.GetAttrStep); ok {
5730+
if strings.Contains(key.Name, "_wo_") || strings.HasSuffix(key.Name, "_wo") {
5731+
propertyVisitInfo.SchemaInfo().Omit = true
5732+
// Since we're omitting these properties entirely, they have no effect at runtime.
5733+
return tfbridge.PropertyVisitResult{HasEffect: false}, nil
5734+
}
5735+
}
5736+
return tfbridge.PropertyVisitResult{}, nil
5737+
},
5738+
)
5739+
57215740
setAutonaming(&prov)
57225741

57235742
prov.MustApplyAutoAliases()

0 commit comments

Comments
 (0)
Please sign in to comment.