问题
I have an AWS Data Pipeline built and keep getting warnings on an EC2 resource's TerminateAfter field being missing. My DataPipeline is designed to use the same instance various times throughout the entire process, which is to run every hour (I haven't run the pipeline yet).
So if I set the Terminate After
field to 3 minutes, I'm wondering if the EC2 instance is terminated 3 minutes after every time it is spun up. Or is the EC2 instance terminated 3 minutes after the last time it is used in the pipeline?
回答1:
"TerminateAfter" is used to prevent runaway processes. You can set an upper time limit for the process to prevent resources from being used indefinitely. The timer starts when the process begins.
https://books.google.com/books?id=uBtRAgAAQBAJ&pg=PA69&lpg=PA69&dq=aws+resources+%22terminate+after%22&source=bl&ots=N50id8RFbJ&sig=ac2dSsLkMOmhNV8wBWdvgCceYrw&hl=en&sa=X&ei=CVQtVeulIIzmsAS46IH4Dg&ved=0CEoQ6AEwCA#v=onepage&q=aws%20resources%20%22terminate%20after%22&f=false
回答2:
TerminateAfter is used to denote when the Ec2 resource is terminated after the creation of resource. So, if you set TerminateAfter field to 3 minutes, your Ec2 resource will be torn down 3 minutes After the creation of your resource.
来源:https://stackoverflow.com/questions/29356664/how-does-aws-data-pipeline-run-an-ec2-instance