Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
147 views
in Technique[技术] by (71.8m points)

amazon web services - Lambda Function to create a Launch Template

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?


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

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...