early-analyst-76866
11/15/2022, 7:51 AMCurrent stack outputs (1):
OUTPUT VALUE
vid vpc-0515230c3d5f949a8
I am able to reference my stack using stack_ref = pulumi.StackReference("PulumiPlay-dev")
but I am not sure how to print the value of vid now. I have tried using the get_output
method but it is not returning anything.echoing-dinner-19531
11/15/2022, 11:35 AMstocky-restaurant-98004
11/15/2022, 1:00 PMpulumi stack output vid
early-analyst-76866
11/15/2022, 3:06 PMimport pulumi
stack_ref = pulumi.StackReference("inline_s3_project/dev")
obj = {"website_url": stack_ref.get_output("website_url").apply(
lambda s3_url: "https://" + s3_url
)}
print(obj)
The output that I am getting still shows me the object and not the value:
{'website_url': <pulumi.output.Output object at 0x109f9f2b0>}
echoing-dinner-19531
11/15/2022, 3:07 PMapply
always returns an Output object. If you did that print inside the apply function it would print the string valueOutput.format("https://{0}", stack_ref.get_output("website_url"))
is probably a nicer way to do this rather than an applyearly-analyst-76866
11/15/2022, 3:10 PMimport pulumi
stack_ref = pulumi.StackReference("inline_s3_project/dev")
obj = {"website_url": stack_ref.get_output("website_url").apply(
lambda s3_url: f"https:// + {print(s3_url)}"
)}
echoing-dinner-19531
11/15/2022, 5:37 PMstack_ref = pulumi.StackReference("inline_s3_project/dev")
obj = {"website_url": stack_ref.get_output("website_url").apply(
lambda s3_url: f"https:// + {s3_url}"
)}
obj["website_url"].apply(lambda s: print(s))
I'd expect that to print out the url