Following the below eventbridge rule on cloudtrail event to get the instanceid, tags value from lambda
{"source": ["aws.ec2"],"detail-type": ["AWS API Call via CloudTrail"],"detail": {"eventSource": ["ec2.amazonaws.com"],"eventName": ["RunInstances"] }}but not able to get the instanceid either of the below code in boto3:
import boto3def lambda_handler(event, context): if event['eventSource'] == 'ec2.amazonaws.com' and event['eventName'] == 'RunInstances': # Get the instance ID from the event instance_id = event['detail']['instance-id'] #instance_id = event['detail']['instancesSet']['items']['instanceId']Any input how to fetch the instanceid and tags details from the above cloudtrail rule