mirror of https://github.com/pulumi/pulumi.git
c231ecd447
12639: sdk/py: Propagate provider from local and remote component resources r=abhinav a=abhinav Each commit is individually reviewable. The first commit just re-applies #12292. --- This change brings back #12292 (fix for #12161), which was reverted in #12522 because it broke MLCs (#12520) and corrects the issue that caused that failure. - #12161 manifests as local component resources not propagating the `provider` option to their children - #12520 manifests as remote component resources (MLCs) not propagating the `provider` option to their children Roughly, given: class MyComponentResource: def __init__(self, ...): # ... self.child = aws.s3.Bucket(..., opts=ResourceOptions(parent=self)) MyComponentResource(opts=ResourceOptions(provider=my_aws_provider)) Both bugs took the form of the `aws.s3.Bucket` above not getting `my_aws_provider`. We previously fixed #12161 by keeping using the provider for the resource only if its package matched the resource's type; otherwise, we placed it in the providers bag for the children of that resource. This had the effect of dropping the provider for component resources because: - `_get_providers` returns a provider (None for component resources) and a bag of providers for children of the resource. It is stored on the resource: |
||
---|---|---|
.. | ||
go | ||
nodejs | ||
proto/go | ||
python | ||
README.md | ||
go.mod | ||
go.sum |