I have one question, ones we created (ex : EC2 , ECR ) resources in AWS using terraform then state file got created. If we delete this state file what will happen. I want to create same ec2 instance what it will show.
Nothing will happen...your resources will stay intact but their control using terraform won't last. That is you won't be able to destroy or operate those resources using terraform...you will have to manually delete or operate them. If you want to create same ec2 instance then you can use the same code already written and just plan and apply the changes then new tfstate file will be created for that
I have one question, ones we created (ex : EC2 , ECR ) resources in AWS using terraform then state file got created. If we delete this state file what will happen. I want to create same ec2 instance what it will show.
Nothing will happen...your resources will stay intact but their control using terraform won't last. That is you won't be able to destroy or operate those resources using terraform...you will have to manually delete or operate them. If you want to create same ec2 instance then you can use the same code already written and just plan and apply the changes then new tfstate file will be created for that
One piece of advice is that don't play the background music ..it is so disturbing and also the image of yours blocks the screen sometimes
Sure, will do the changes! Thanks