How does opts.parent work with ComponentResources?...
# python
p
How does opts.parent work with ComponentResources? It appears that if I create child resources, they don’t actually get processed by the engine, eg: class Network(ComponentResource): __init__(…): super().__init__(…) self.vpc = ec2.vpc(…)
i
what do you mean “not processed by the engine”? they don’t get created?
p
yup.
So I could see Network.init being called and ec2.vpc creating a VPC object, but then there was no mention of it when I did “pulumi up”
If I changed the parent of the vpc to the stack root object with pulumi.get_root() it worked
seems to be something related to opts.parent and opts.provider
If I wanted a ComponentResource to hold a bunch of aws: resources, it doesn’t have a provider associated but it is the parent, so when the aws resources are created, they appear not to be able to find the provider
i
hmm, that seems like a bug - do you mind opening an issue with a repro on github.com/pulumi/pulumi?
I’ll check it out