https://pulumi.com logo
#dotnet
Title
# dotnet
c

colossal-vr-62639

03/18/2022, 9:30 AM
Is there a way to set outputs like the following?
Copy code
using System.Collections.Generic;
using Pulumi;
using Pulumi.Aws.S3;

return await Deployment.RunAsync(async () =>
{
    var outputs = new Dictionary<string, object?>();

    var bucket = new Bucket("items", new BucketArgs { });

    bucket.Arn.Apply(arn =>
    {
        outputs.Add("arn", arn); //here
        return arn;
    });

    return outputs;
});
t

tall-librarian-49374

03/18/2022, 9:34 AM
This won’t always work as Arn.Apply won’t resolve until the resource is deployed, so your outputs will be empty on the initial run
AFAIK you can return outputs as dictionary values
Copy code
outputs.Add("arn", bucket.Arn);
3 Views