pulumi / pulumi/pulumi-java

[api/suggestion] DRY with `CustomResourceOptions` context

Open
#412 3 comments 0 reactions 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

This is low priority.

When working with kubernetes, I find that I have to pass CustomResourceOptions everywhere.

I would like to follow DRY.

old

    final var clusterResourceOptions = CustomResourceOptions
        .builder()
        .provider(clusterProvider)
        .build();
    new Deployment("myDeployment1", myDeploymentArgs1, clusterResourceOptions);
    new Deployment("myDeployment2", myDeploymentArgs2, clusterResourceOptions);
    new Deployment("myDeployment3", myDeploymentArgs3, clusterResourceOptions);

new(runWithCustomResourceOptions name subject to change)

Pulumi.runWithCustomResourceOptions(myCustomResourceOptions, () -> {
    new Deployment("myDeployment1", myDeploymentArgs1);
    new Deployment("myDeployment2", myDeploymentArgs2);
    new Deployment("myDeployment3", myDeploymentArgs3);
});
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 reviewing the Java API entry points named in the proposal: CustomResourceOptions, Pulumi, and Deployment. Clarify the design and naming for runWithCustomResourceOptions, then establish how equivalent Deployment calls should inherit the options and what tests or examples will demonstrate that the explicit arguments are no longer required.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kubernetes
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.