pulumi / pulumi/pulumi-java

Permit user programs that decide on stack outputs in a Future

Open
#660 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

api/suggestion area/languages kind/enhancement
Dominant language
Java
Stars
85
Forks
26
Avg merge
11h 49m
Merged PRs (30d)
22

Description

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Current signature Pulumi.run assumes that the program will immediately register the stack outputs:

        Pulumi.run(ctx -> {
            ctx.export("a", Output.of(1));
        });

What if the program does not know what the set of stack outputs is going to be until some CompletableFuture? The awkward workaround right now is to force (join) the Future inside the Pulumi program:

        CompletableFuture<String> xname;
        Pulumi.run(ctx -> {
            var x = xname.join();
            ctx.export(x, Output.of(1));
        });

It would be nice to allow deferring that without blocking a thread. Perhaps Pulumi.run(Function<Context,CompletableFuture<Void>>) overload to let the user program signal to the framework that it has some work to do.

I believe underlying framework supports this just fine, but we do not expose this capability to the user at the moment.

Not sure how useful this is in practice, but logging for posterity.

Affected area/feature

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing Pulumi.run API and the framework's current handling of CompletableFuture-based work. Clarify the overload design, then verify that deferred stack outputs can be registered without blocking and add coverage for the asynchronous completion behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.