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년 전1769회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠