https://pulumi.com logo
Title
p

proud-artist-4864

02/27/2019, 3:00 AM
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

incalculable-sundown-82514

02/27/2019, 6:00 AM
what do you mean “not processed by the engine”? they don’t get created?
p

proud-artist-4864

02/27/2019, 8:21 AM
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

incalculable-sundown-82514

02/27/2019, 5:34 PM
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