Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulumi up --refactor: Making refactoring stacks easy #16209

Open
iwahbe opened this issue May 16, 2024 · 0 comments
Open

pulumi up --refactor: Making refactoring stacks easy #16209

iwahbe opened this issue May 16, 2024 · 0 comments
Labels
area/engine Pulumi engine kind/enhancement Improvements or new features

Comments

@iwahbe
Copy link
Member

iwahbe commented May 16, 2024

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

Renaming resources and moving them into and out of component resources is doable in pulumi with aliases, but it requires you to know how resource URNs work. Using aliases requires you to make multiple code edits to insert the aliases, run pulumi up --expect-no-changes and then manually remove the aliases.

We should add a new flag to pulumi up: --refactor. When pulumi up --refactor is run, pulumi runs the user program and tries to modify the existing state to match the new state suggested by the user's program.

Old resource state can be matched up with new resource requests via:

  • Name
  • Property set

Importantly, pulumi up --refactor would allow the creation and deletion of component resources, making it simple to move a resource (or a set of resources) into a component resource our out of a component resource.

To avoid ambiguity, --refactor prevents creates, updates and deletes of custom resources.

This is a possible implementation of #6078.

Affected area/feature

@iwahbe iwahbe added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team area/engine Pulumi engine labels May 16, 2024
@justinvp justinvp removed the needs-triage Needs attention from the triage team label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Pulumi engine kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants