Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm new to AWS and trying to create a lambda function to create a launch template daily. So we have a lambda function that is currently creating daily AMI's of EC2 instances that we are running. Is there any way to automatically run a lambda function daily to create a launch template using the latest created AMI as soon as the daily AMI creation as completed and also delete the old launch templates after certain days?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
147 views
Welcome To Ask or Share your Answers For Others

1 Answer

So you create an event rule as shared in this question is-it-possible-to-get-or-generate-event-for-ami-availability-without-polling.

And then hook your lambda function for creating the launch template to the above event.

I checked the other solution for checking the events for CreateImage and RegisterImage seems like they are triggered immediately as soon as you make the call.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...