calm-actor-89994
01/20/2025, 10:53 AMsubnet = aws.ec2.Subnet("subnet", vpc_id="vpc-1234", tags={"Name": "my-custom-name"})
# I want to get {"Name": "my-custom-name"}
specifically inputs, not outputs, which can be known only after creating resource. I was exploring subnet.___dict___
but didn't find any attribute where props could be stored
2. was it ever considered to have async interface for outputs? e.g. instead of doing something like:
subnet.id.apply(lambda x: print(x))
I would do:
print(await subnet.id)
modern-zebra-45309
01/20/2025, 1:54 PMsubnet.tags
and handle it like any other output.
2. This doesn't work, because the output values are not available at program runtime. They are only resolved later (see https://www.pulumi.com/docs/iac/concepts/inputs-outputs/#outputs) and thus cannot be converted into plain/"native" types or printed (which would require converting an output into a string first).calm-actor-89994
01/20/2025, 1:59 PMawait
would allow to continue running the program when the dependent resource has been provisioned, no?modern-zebra-45309
01/20/2025, 1:59 PMmodern-zebra-45309
01/20/2025, 2:02 PMI understand how outputs work. that's exactly why I am asking if async python was ever considered as an interface instead of the callback.No, that doesn't work, because resources are not provisioned in the order in which the program runs. The program declares the infrastructure state you want to have, producing a graph (DAG). Then, Pulumi takes this desired state and compares it to what's there, taking into account and resolving all resource dependencies. Running the same program leads to very different activities and orders depending on the current infrastructure state.would allow to continue running the program when the dependent resource has been provisioned, no?await
modern-zebra-45309
01/20/2025, 2:05 PMif I want to access output, I need to do apply. this defeats what I am asking as my input is available before we start infra provisioningIf you're the one setting the tag, you have access to it, no?
my_tags = {"key": "some value"}
subnet = aws.ec2.subnet(..., tags=my_tags)
my_extended_tags = {**my_tags, "extra-key": "some value"}
subnet2 = aws.ec2.subnet(..., tags=my_extended_tags)
modern-zebra-45309
01/20/2025, 2:10 PM