简体   繁体   English

AWS Step Function keyerror

[英]AWS Step Function keyerror

I am following this guide to send approval emails to myself: https://aws.amazon.com/blogs/aws/using-callback-urls-for-approval-emails-with-aws-step-functions/我正在按照本指南向自己发送批准电子邮件: https://aws.amazon.com/blogs/aws/using-callback-urls-for-approval-emails-with-aws-step-functions/

The code in this guide is exactly the same as mine & I have given this input to the step function:本指南中的代码与我的完全相同,我已将此输入提供给步骤 function:

{
  "name": "TestName"
}

Every time I try to run the step function, i get the following error: Error每次我尝试运行步骤 function 时,我都会收到以下错误:错误

KeyError Cause KeyError 原因

{
  "errorMessage": "'urls'",
  "errorType": "KeyError",
  "stackTrace": [
    "  File \"/var/task/lambda_function.py\", line 35, in lambda_handler\n    urls = json.loads(response['Payload'].read())['urls']\n"
  ]
}

Its referring to this line: urls = json.loads(response['Payload'].read())['urls'] this line is part of the code that is in the AWS Lambda function.它指的是这一行: urls = json.loads(response['Payload'].read())['urls']这行是 AWS Lambda ZC1C425268E687A944Z5074FC 中的代码的一部分

What does this error mean, What can I do to fix this?这个错误是什么意思,我该怎么做才能解决这个问题?

I have never tested that Lambda/Python end to end doc so i cannot tell if you it works.我从未测试过 Lambda/Python 端到端文档,所以我无法判断它是否有效。 However, this one definitely works.但是,这个绝对有效。 It invokes multiple AWS Services via a Lambda function and does include sending email messages.它通过 Lambda function 调用多个 AWS 服务,并且确实包括发送 email 消息。 It uses the Java V2 AWS SDK.它使用 Java V2 AWS SDK。

Using AWS Step Functions and the AWS SDK for Java to build workflows that sends notifications over multiple channels 使用 AWS Step Functions 和 AWS SDK for Java 构建通过多个渠道发送通知的工作流

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM