-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass opts
to wrapped Pulumi resources
#621
Comments
This would also allow a workaround for #617 |
Hmm interesting. We'll need to consider the case when there are multiple resources inside a component. |
@jayair , since there is a |
@remembell-root Which opts field are you looking to pass to child resources?
Pulumi passes a subset of opts to child resources by default, ie. |
In the latest version of SST, u can transform opts like this new sst.aws.Bucket("MyBucket", {
transform: {
bucket: (args, opts) => {
opts.retainOnDelete = true;
},
},
}); |
@fwang, thanks for implementing this. I'm sorry, I don't understand why use function transform and not pass the entire |
Cos the bucket component has multiple resources in it |
@jayair , could you please make notes for next major release to discuss the api change I suggested? It will make my code much cleaner and simpler to understand. |
In many of the custom resources you use to wrap Pulumi's resources (SnsTopic, S3, etc) you don't pass the
opts
, and I see it as an error that needs fixing.For example, in
SnsTopic
the code is:so,
aws.sns.Topic
only gets{ parent }
asopts
.It can be fixed by doing something similar to:
The text was updated successfully, but these errors were encountered: