describe_instances not returning latest state of ec2-instance #4386
Labels
bug
This issue is a confirmed bug.
ec2
investigating
This issue is being investigated and/or work is in progress to resolve the issue.
p3
This is a minor priority issue
Describe the bug
I have a event rule which calls a lambda when a ec2-instance's state is changed. Rule's instance id list is configured such that it only has on demand instances. Now when I stop/run my instance it changes states as follows
stopped -> pending -> running
running -> stopping -> stopped
In each transition my lambda get's called. Sometime when I do describe_instances(instance_id) (instance_id is provided by event rule) it returns old state of ec2-instance.
For example if I have ran my ec2-instance, lambda should log pending and running in two consecutive logs.
Instead sometimes it logs stopped and pending.
Regression Issue
Expected Behavior
lambda should log current state of ec2-instance
Current Behavior
Lambda is logging old state of ec2-instance
Reproduction Steps
I am not sure how to reproduce this as sometime this happens and sometimes not,
but here is the minimal code I am using
Possible Solution
No response
Additional Information/Context
No response
SDK version used
Python: python3.10, boto3-1.35.95
Environment details (OS name and version, etc.)
Amazon Linux 2023
The text was updated successfully, but these errors were encountered: