Hi Team, I have just started working on the Pulumi...
# getting-started
b
Hi Team, I have just started working on the Pulumi and need your guidance. I have to delete few unused static public IP addresses/assignments and they have not exist on the pulumi state file. When I have checked the azure portal that resource json shows me that its attached with tags "source": "pulumi-XXXX" . so If I remove the resource directly from the azure portal then pulumi preview complaint about that resources. What is the best practice I have to use in this scenario. Thanks in advance for the help!!
l
Remove the code that created them, then run Pulumi up.
b
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
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
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
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.