Remove the code that created them, then run Pulumi up.
b
breezy-architect-90539
06/28/2022, 8:31 AM
Thanks for responding...actually we have very generic code so any app deployment we need to add its details to our pulumi.env.yaml file and it will deploy that app on the azure portal. Now I have to remove the unused IPs while removing the few load balancer and gateway ips still exist in pulumi state file. should I directly remove the LB ips from azure as they are not associated with any RG however exist in pulumi state. So its bit confusing to do a pre check for any dependencies?
l
little-cartoon-10569
06/28/2022, 8:26 PM
You can run
pulumi refresh
to get Pulumi to learn about your changes, but that will just mean that Pulumi will try to recreate them later. You need to make your code correctly describe your intended state. If the generic code can't do it, then maybe more specific code would be the way to go?
b
breezy-architect-90539
07/01/2022, 5:28 AM
yes that correct...is there any way pulumi guide us that the created resources are not being used or not dependent on any other resources
l
little-cartoon-10569
07/03/2022, 11:16 PM
No, Pulumi can't tell if you're using a resource. If you remove a resource from code, then your next
pulumi up
will attempt to delete it; if the deletion is successful, then nothing was dependent on it.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.