https://pulumi.com logo
#getting-started
Title
# getting-started
p

polite-napkin-90098

04/20/2021, 4:05 PM
I have another noob question: What happens if I create a LB by hand in AWS, then import it into a stack so I can fiddle the Listener rules, and then I destroy the stack? Does Pulumi somehow remember that the LB wasn't created in Pulumi and leave it be, or does it just destroy it anyway? What about the Listener rules that got mutated, can they be restored on destruction of the mutating stack?
b

brave-planet-10645

04/20/2021, 4:08 PM
Hi. Once you've imported it into the Pulumi stack, Pulumi takes ownership so if you destroy your Pulumi stack then the LB will be deleted.
You can then remove the resource from the stack once you've finished with it
So it won't be deleted
p

polite-napkin-90098

04/20/2021, 4:09 PM
So the flow would be, import the LB, mutate the Listener, use it, then when the test cluster is no longer used, mutate the Listener back and remove the LB from the stack, then delete the stack, thanks.
Does this change significantly if I have another stack managing the LB, can the Listener be managed by more than one stack at once?
b

brave-planet-10645

04/20/2021, 4:11 PM
It can be, but you'll be over writing it when you deploy from one to the other
Is there any reason why you'd want to not create, update and destroy with Pulumi rather than using the console?
p

polite-napkin-90098

04/20/2021, 4:11 PM
So each stack would need to import the current state and the mutate it, I guess. Ok thanks, food for thought.
No reason, but it has already happened. I built the Infra by clicking things in the console. Now I want to use Pulumi to enable launching adhoc test environments using containers built from feature branches, but to avoid having to do DNS fiddles I can use the *.test LB which I created by hand.
The next step would be to write the stack to manage the already built infra, hence the question about mutiple stacks managing the same listener
I could also just make a new LB for each adhoc test, but I wanted to know if the other way was possible.
b

brave-planet-10645

04/20/2021, 4:14 PM
So the beauty of Pulumi is that you can import resources bit by bit and take over the management from the console to Pulumi.
p

polite-napkin-90098

04/20/2021, 4:15 PM
yup :-)
3 Views