我有一个lambda函数,每次在bucket中创建一个文件夹时,它都需要获取一个文件夹名。现在,这个文件夹的名称是随机生成的字符,需要从生成它的另一个lambda函数的cloudwatch日志中获取。我想将这两个函数分开,但我不确定如何将其他lambda函数的cloudwatch日志中的数据提取到我的this新函数中。
脚本:
/aws/lambda/function1是具有以下日志的日志组:
{
"version": "0",
"id": "c81a8ef6-0a49-4556-3881-e7e3503d59f9",
"detail-type": "MediaConvert Job State Change",
"source": "aws.mediaconvert",
"account": "0065215****",
"time": "2021-07-06T19:28:32Z",
"region": "us-east-1",
"resources": [
"arn:aws:mediaconvert:us-east-1:00652154****:jobs/1625599685105-ctk2d6"
],
"detail": {
"timestamp": 1625599712491,
"accountId": "006521****",
"queue": "arn:aws:mediaconvert:us-east-1:006521548261:queues/Default",
"jobId": "1625599685105-ctk2d6",
"status": "COMPLETE",
"userMetadata": {
"guid": "29fdf1ab-3f82-45c7-a261-4c2e1658e6dc",
"workflow": "media-convert"
}
.............
我需要在新的lambda函数中从上述日志中获取guid,如下所示:
import boto3
client = boto3.client('mediatailor')
response = client.put_playback_configuration(
AdDecisionServerUrl='Ad_URL',
Name='sample',
VideoContentSourceUrl='s3://bucketname/**guid**'
)
如果有人能帮忙,请告诉我。提前谢谢
暂无答案!
目前还没有任何答案,快来回答吧!