agreeable-angle-1483
01/19/2020, 4:52 PMVPC
and Subnet Network
with Pulumi in python and during the process to understand the relationships management in Pulumi, I’ve created the following 3 files (attaching in the comments):
network.py
- which contains the python functions I want to use in multiple projects
Pulumi.stg.yaml
- contains the configurations
__main__.py
- main code with calls to the functions
When I ran this code I saw there is no relationship management, I have tried to use ResourceOptions(parent\child)
I’ve also tried to use the dependsOn:
but I didn’t success to use it, I think in both options the resource should be exists before, and I want to know how to do it right.
I’d be glad to get some examples because I didn’t find on the internet.
Thanks a lotcolossal-ram-89482
01/20/2020, 3:22 AMcompute.Subnetwork(...)
with network
set to the string value of the vpc_name
variable, which is "lala"
. Instead you would set network
equal to the object that is returned from compute.Network(...)
. This should establish the desired relationship.create_vpc()
would return that Network
object, not the result of pulumi.export(...)
. I expect that pulumi.export()
returns None
.agreeable-angle-1483
01/20/2020, 2:49 PMcolossal-ram-89482
01/20/2020, 6:13 PMpulumi.output.Output
which can be used as inputs to other resources. And then 2) stack outputs which are created by pulumi.export()
.white-balloon-205
01/20/2020, 7:28 PMagreeable-angle-1483
01/21/2020, 6:43 AMpulumi.output
and pulumi.input
? I.e 2 resources with a dependency
I didn't findcolossal-ram-89482
01/21/2020, 12:57 PMweb_bucket
is of type pulumi_aws.s3.Bucket
web_bucket.id
is of type pulumi.output.Output[str]
then in the for
loop:
obj
is of type pulumi_aws.s3.BucketObject
obj.bucket
is of type Input[str]
obj.bucket
is set to web_bucket.id
// assigning Input
to Output
Thus all of the `obj`s (bucket objects) are dependent on the creation of web_bucket
(the bucket itself)agreeable-angle-1483
01/22/2020, 8:52 AMcolossal-ram-89482
01/22/2020, 12:25 PM