Terraform : Destroy specific resource

preview_player
Показать описание
In this video we learned how to destroy the specific resources :
$ terraform state list
$ terraform destroy -target RESOURCE_TYPE.NAME
$ terraform destroy -target RESOURCE_TYPE.NAME -target RESOURCE_TYPE2.NAME
$ terraform state list

*** For multiple resources ****
$ terraform state list
$ terraform destroy -target=RESOURCE_TYPE.NAME -target=RESOURCE_TYPE2.NAME
$ terraform state list
1
# Remove a Resource

# Remove a Module
1
2
3
4
5
# Remove a Resource

# Remove a Module

My name is Arun Pachehra and i am an IT Professional & a fitness enthusiast. Its been more than 12 years working with various technologies and now i am planning to share with you all. As per plan i am going to publish the entire Az 300 series first and if things would go as planned then a lot of stuff would come your way including Q&A , Production issues and various interesting stuff.
Рекомендации по теме
Комментарии
Автор

Excellent video, it's amazing that Terraform does not make this more explicit in their docs, outside of chat forums I could only find this in an Oracle document on Terraform.

reedthor
Автор

so same procedure for the resources created via terraform modules?

somedeveloper
Автор

Thanks, for clear video - assuming the main.tf file also needs to have the resource removed or is this done automatically?

swapnasarangdhar
Автор

Hey, thanks for the video... I have several resources that I made from terraform, but I have changed them manually in aws, now I want to deploy cognito, from the same file but it will destroy the changes that I have made in aws, is there a way to ignore those resources and create only the one that I need?

LeonardoArangoCifuentes
Автор

How can I achieve this through Java code? I mean I am triggering terraform using java code, but, I want one resource to be destroyed first then the rest. Is that possible?

raw_wish