worried-engineer-3388405/20/2019, 5:34 PM
, I get back another output that I believe has a future wrapped up in it that will execute my lambda. When does that actually get awaited?
my_resource.some_output.apply(lambda val: print(val))
white-balloon-20505/20/2019, 5:36 PM
is available (either after a resource is created or updated) the Pulumi engine will cause that future to be resolved with the value of the resource returned by the cloud provider.
worried-engineer-3388405/20/2019, 5:37 PM
white-balloon-20505/20/2019, 5:48 PM
worried-engineer-3388405/20/2019, 5:55 PM
def test_bucket_name_is_my_bucket(): from infrastructure import bucket_name assert bucket_name() == "my-bucket" @pytest.mark.asyncio async def test_bucket_urn_is_my_bucket(): from infrastructure import bucket bucket_urn = await get_output(bucket.urn) assert bucket_urn.endswith("aws:s3/bucket:Bucket::my-bucket") def get_output(output): future = asyncio.Future() output.apply(lambda value: future.set_result(value)) return future