gpt4 book ai didi

linux - 从 shell 向 CloudWatch 发送事件

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:33:43 28 4
gpt4 key购买 nike

我有一个问题

我需要从 EC2 容器内的 shell 脚本向 AWS CloudWatch 发送事件。可能吗?

感谢帮助

最佳答案

您可以使用 AWS CLI 来执行此操作。

aws events put-events --entries file://putevents.json

putevents.json 中的以下内容:

[
{
"Source": "com.mycompany.myapp",
"Detail": "{ \"key1\": \"value1\", \"key2\": \"value2\" }",
"Resources": [
"resource1",
"resource2"
],
"DetailType": "myDetailType"
},
{
"Source": "com.mycompany.myapp",
"Detail": "{ \"key1\": \"value3\", \"key2\": \"value4\" }",
"Resources": [
"resource1",
"resource2"
],
"DetailType": "myDetailType"
}
]

完整引用:

https://docs.aws.amazon.com/cli/latest/reference/events/put-events.html

关于linux - 从 shell 向 CloudWatch 发送事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53326445/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com