// Copyright 2016-2020, Pulumi Corporation. All rights reserved. using System.Collections.Generic; using System.Threading.Tasks; using Pulumi; using Pulumi.Random; class GetResource : CustomResource { [Output("length")] public Output Length { get; private set; } = null!; public GetResource(string urn) : base("unused:unused:unused", "unused", ResourceArgs.Empty, new CustomResourceOptions {Urn = urn}) { } } class Program { static Task Main(string[] args) { return Deployment.RunAsync(() => { var pet = new RandomPet("cat"); var getPetLength = pet.Urn.Apply(urn => new GetResource(urn).Length); return new Dictionary { {"getPetLength", getPetLength} }; }); } }