You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a provider author I would like to be able to specify auto-populating the "version" ResourceOption. The scenario
where this helps: a new major version v2 is being released where my.Resource can no longer be supported in the provider
and is now deprecated. Automatically setting "version" will allow end-user programs to upgrade to v2 without changes
while serving the resource with the older retained version of the provider.
I have tested this change by modifying the generated aws.s3.Bucket constructor to add a few lines:
opts.version="6.33.0";opts=pulumi.mergeOptions(utilities.resourceOptsDefaults(),opts);console.log("setting version to 6.33.0");console.log(opts.version);
And it does seem to afford the flexibility of seamless upgrades while dropping a resource implementation.
This functionality complements the ability of the provider to set a default Type alias which simplifies upgrades when
the token is changing.
The work here is likely a minimal extension of codegen but needs to be carried out for each language with tests:
typescript
python
go
dotnet
java
yaml
A provider author utilizing this feature would need to retain a frozen copy of the resource schema to continue passing
it to the resource generator. A more general alternative of this work would make that easier, that is, it would support
a form of #5331 for resource specs and automate locating the schema from the
given version so that the provider can forget the schema and simply leave a stub pointer:
Resources: map[string]ResourceSpec{ // informs actual schema and implementation -----v"aws:s3/bucket:LegacyBucket": ResourceSpec{Ref: "/provider/v6.35.0/schema.json#aws:s3/bucket:Bucket"}
// ^--- informs which type to place this into
}
This sounds a little more involved though and in terms of impact providers will be likely very happy with just the version support.
The text was updated successfully, but these errors were encountered:
As a provider author I would like to be able to specify auto-populating the "version" ResourceOption. The scenario
where this helps: a new major version v2 is being released where my.Resource can no longer be supported in the provider
and is now deprecated. Automatically setting "version" will allow end-user programs to upgrade to v2 without changes
while serving the resource with the older retained version of the provider.
I have tested this change by modifying the generated aws.s3.Bucket constructor to add a few lines:
And it does seem to afford the flexibility of seamless upgrades while dropping a resource implementation.
This functionality complements the ability of the provider to set a default Type alias which simplifies upgrades when
the token is changing.
The work here is likely a minimal extension of codegen but needs to be carried out for each language with tests:
A provider author utilizing this feature would need to retain a frozen copy of the resource schema to continue passing
it to the resource generator. A more general alternative of this work would make that easier, that is, it would support
a form of #5331 for resource specs and automate locating the schema from the
given version so that the provider can forget the schema and simply leave a stub pointer:
This sounds a little more involved though and in terms of impact providers will be likely very happy with just the
version
support.The text was updated successfully, but these errors were encountered: