Creation / Destroy Time

Contents

Roadmap info from [roadmap website](https://roadmap.sh/terraform/creation / destroy time@CJfCpRN_oVf6n_EfLNJSV)

Creation and destroy-time provisioners in Terraform are used to execute actions at specific points in a resourceโ€™s lifecycle. Creation-time provisioners run after a resource is created, while destroy-time provisioners run before a resource is destroyed. Creation-time provisioners are useful for tasks like initializing a newly created server, installing software, or configuring applications. Destroy-time provisioners are typically used for cleanup tasks, such as deregistering a server from a load balancer before deletion. Both types can be specified within a resource block.

Creation-time provisioners that fail will cause the resource creation to fail, potentially leaving resources in an incomplete state. Destroy-time provisioners that fail donโ€™t prevent resource destruction but may leave external resources in an inconsistent state. Due to their potential impact on Terraformโ€™s ability to manage state consistently, both types should be used cautiously and designed to be idempotent and fault-tolerant.


#ready #online #terraform #IaC #infrastructure