Start & Stop of EC2 instance using tags in Lambda function

0

Is there is any way to start & stop an EC2 instance using the tags in lambda function. Currently i am using a lambda function to start & stop an EC2 instance by the instance id. if the instance got replaced, the lambda function is not working. So inorder to fix this issue, i am curious on setting up a lambda function to start & stop the instance by using the Tags instead of instance id.

已提问 2 年前1735 查看次数
2 回答
2
已接受的回答

Not directly with the API. You will need to update your Lambda function to DescribeInstances and filter on the tag key/value combination you desire and pass the returned instance ID to the relevant StartInstances/StopInstances method.

AWS
已回答 2 年前
1

if you want to make it easier for yourself, look at this:

https://aws.amazon.com/solutions/implementations/instance-scheduler/?nc1=h_ls

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则