Auto terminate emr

Hi , how to add auto termination of EMR cluster in terraform script after idle time.

Hi @nshamriya,

If this is possible then it would be achieved using features built in to AWS, rather than features in Terraform. Terraform doesn’t run in the background or on a schedule, so it can only configure other systems to take scheduled actions and not take scheduled actions itself.

I don’t know if EMR itself has automatic termination features but you may be able to design something which involves an AWS Lambda function that runs at a scheduled time.

I don’t have any direct experience with this problem so I can’t show a complete example, but I’ve moved this topic into the AWS provider forum in the hope that someone there will have more ideas or more information on the idea I already mentioned.

1 Like

@apparentlymart :Thanks a lot for your reply.
i read EMR 3.50.0 onwards it supports idle timeout and auto termination after idle timeout. Wanted to configure same thing in terraform while creating the cluster. Please et me know once you figure this out with aws.