How I can destroy asnible generated resources in AWS with a playbook?
Actually, as we can removed all the resources created by terraforms by single script, can I do same with ansible?
How I can destroy asnible generated resources in AWS with a playbook?
Actually, as we can removed all the resources created by terraforms by single script, can I do same with ansible?
If you created resources using cloud formation templates it should be clean enough to delete them in the same way.
Otherwise I would think you would need logic to find the resources and remove them one by one.
Like if your stack resources include a build number tag or git commit hash as an example then you could search for resources with that tag and delete them.
But by default ansible doesn’t keep a state file like terraform so it doesn’t just know what should tear down.
Can I instantiate terraforms scripts by ansible?
There is a module for terraform or command actions, so if you meet those requirement I don’t see why not.
https://docs.ansible.com/ansible/latest/modules/terraform_module.html
Mean I need to install anisble and Terraform both on same VM?
That is my reading of the module yes. The controller executing the tf template must also have terraform installed and likely in the environment path.
thx man