I'm developing an AWS lambda function that is triggered from an event bridge and then putting another event using python but struggling to retrieve a value from a variable in the Json string
below is the code
import json, boto3
client = boto3.client('events')
def lambda_handler(event, context):
testV2_dict={
"K1" : event['e1'] ,
"K2" : event['e2']
}
#converting python to json as (put_event - Details) section is expecting json
testV2=json.dumps(testV2_dict)
response = client.put_events(
Entries=
[
{
"DetailType": "test",
"Source": "test",
"Detail": "{ \"testK\": \"testV\",\"testK2\": \""+ testV2 +"\" }"
}
]
)
tried to add Details on different ways,
"Detail": "{ \"testK\": \"testV\",\"testK2\": \""+ testV2 +"\" }" and still getting error as Malformated Details
and if i deleted the ++, I'm getting word testV2 itself not the value from the above
How can I retrieve the value of testV2 in the Details inside the event?