我有一个问题
我需要从 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/