如何将数据从CloudWatch事件规则传递给Lambda?

发布于 2025-01-30 06:20:33 字数 150 浏览 4 评论 0原文

我在CDK包中创建了一个lambda。我想创建一个触发lambda的CloudWatch Eventbridge规则。我想使用CloudWatch规则本身将我的值传递给Lambda。 我不想对CDK代码进行任何更改。我该怎么做?有什么可能的选择?

我可以使用标签或事件吗?

I have created a Lambda in CDK Package. I want to create a CloudWatch EventBridge Rule that triggers a Lambda. I want to pass my values to the Lambda using the CloudWatch Rule itself.
I don't want to make any changes to the CDK code. How can I do it? What are the possible options?

Can I use Tags or Events?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

够钟 2025-02-06 06:20:33

您可以将数据从CloudWatch规则传递给LAMBDA,通过将JSON作为输入传递来触发它。将输入JSON传递到目标。

例子:

final Target target = new Target()
                .withId(LAMBDA_TARGET_ID)
                .withArn(functionArn)
                .withInput(jsonString);

You can pass data from Cloudwatch Rule to the lambda that it triggers by passing a JSON as Input. Pass the Input JSON to the Target.

Example:

final Target target = new Target()
                .withId(LAMBDA_TARGET_ID)
                .withArn(functionArn)
                .withInput(jsonString);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文