able-doctor-68496
10/01/2021, 4:13 PMprops
argument to the ComponentResource
constructor: https://www.pulumi.com/docs/reference/pkg/python/pulumi/#the-pulumi-python-resource-model-1
My main questions about it are:
• When would I want to pass something to this props
argument?
• What would I pass to that argument?
For example, currently I’m passing a Kubernetes namespace to a “parent” ComponentResource
that I’ve created. I’m passing it like so:
def __init__(..., namespace: Namespace, ...):
super().__init__(
...,
props={'namespace': namespace},
...
)
Is that the correct way to use props
? My thinking was that this would let the Pulumi “engine” know that there is an ordering requirement between the namespace and my ComponentResource
. Is that how it works? If not, then what are props
for?great-sunset-355
10/05/2021, 12:47 PM__init__
can take args
or arguments directly
def __init__(__self__,
resource_name: str,
args: Optional[ZoneArgs] = None,
opts: Optional[pulumi.ResourceOptions] = None):
args
is later in the code assigned to __props__
I have a feeling that props
argument name came from JS/TS in this case and therefore is a typo in docs.
As for the usage of props, here is an example.
# with props
route53.Zone(
args=route53.ZoneArgs(name="<http://example.com|example.com>")
)
# without props
route53.Zone(name="<http://example.com|example.com>")
@billowy-army-68599 Could you please verify the correctness of my statement, we could then fix the docs together. Thank you!billowy-army-68599
great-sunset-355
10/06/2021, 6:51 AMred-match-15116
10/06/2021, 5:27 PM