icy-controller-609201/07/2024, 8:30 AM
dry-keyboard-9479501/07/2024, 11:46 AM
echoing-dinner-1953101/08/2024, 2:21 PM
Why do the inputs have to match? iIf they didn't you would have differences between what your state records and what the actual cloud state is. If you use the
command we warn about this but it's not an error, because you still have a chance between the run of
to fix it.
But if using the import option the engine wants to do any update there and then, there's no opportunity to run refresh or fix another way. So we have the option of either
B) Ignore the inputs defined in your program
Given the whole point of
is to make the cloud state look like what your program says that pretty much excludes doing B.
dry-keyboard-9479501/08/2024, 2:35 PM
icy-controller-609201/08/2024, 10:34 PM
echoing-dinner-1953101/08/2024, 11:31 PM
when using the import option can the resource not spawn both an import and an update into the plan?We could, but now you need to be careful about watching for warnings on preview (and hopefully your running preview not just up) to check that your not inadvertently changing a resource that you thought you were just importing. This is very much a trying to find a balance for good overall UX thing, not a technical thing.
icy-controller-609201/08/2024, 11:48 PM
echoing-dinner-1953101/08/2024, 11:52 PM
but then you need to work out a good UX around making sure people are aware of that option and what exactly it means
icy-controller-609201/08/2024, 11:54 PM
echoing-dinner-1953101/09/2024, 12:00 AM
there are no gutter guards in that scenario, so I don't see why they should be additional guards for the import flow?Well there can't be any guards in that case, we've got nothing to compare against.
trepidation around imports has really put me off that as a flow for moving resources between stacksThe
command is probably better for this, but I'd really like to write a proper transfer command at some point. Something like
to transfer resA from stackA to stackB and call it resB.
transfer stackA/resA stackB/resB
icy-controller-609201/09/2024, 12:04 AM
we've got nothing to compare againstfor an update, you are comparing against the previously known state
this would be a fantastic addition, it might even be a good idea to alert people in the docs that they should use microstacks for new projects only -- and wait until
transfer stackA/resA stackB/resB
is available before refactoring existing projects into microstacks
this is the page where the warning should be placed: https://www.pulumi.com/docs/using-pulumi/organizing-projects-stacks/
echoing-dinner-1953101/09/2024, 12:15 AM
for an update, you are comparing against the previously known stateWell yes, but you clearly need to be able to change things in that scenario. If we err'd that the inputs didn't match you'd never be able to change anything.
this would be a fantastic additionYeh I'll talk to docs about that
icy-controller-609201/09/2024, 12:17 AM
- the program needs to be effective - i think it should also not be done for
matching inputs is sometimes not even possible in the context of the new stack, for example inputs might need to be changed to reflect the destination stack environment - and having the imported resource still reflecting the old context after a successful import also seems like a inconsistent state to leave your program in between runs
echoing-dinner-1953101/09/2024, 12:22 AM
why even err when the inputs don't match, in the import scenario?Because it was quite common for people to think they were importing a resource exactly as is but inadvertently causing an update because the inputs didn't exactly match. Arguably this is user error and they should have looked at the preview more closely but alas humans are human.
and having the imported resource still reflecting the old context after a successful import also seems like a inconsistent state to leave your program in between runsYes, that's a good case for when you really do mean to import and then update in the same operation. It might be worth raising an issue to discuss this. It may be that we can solicit enough input that it would be ok to just allow import/update in one step.