Posts

Showing posts with the label terraform-provider-aws

Can terraform tf file or module automatically expire resources?

Can terraform tf file or module automatically expire resources? In cloudformation you can set a TTL on a stack that runs a command which deletes the stack: https://aws.amazon.com/blogs/devops/scheduling-automatic-deletion-of-application-environments/ How do I do this in a TF file? OR maybe I could have a script that gets the create time of a tf file (the state file), compare that with the current time and do a destroy? that might work too Cloudformation itself doesn't have a way of self terminating at some specific time. That link shows a Cloudformation template that creates an instance that tears down the stack using at to run a script to delete the stack at a specific time. You could use the same principle with Terraform as long as your Terraform config created an instance with permissions and configuration to be able to do that. – ydaetskcoR Jul 2 at 13:09 ...