Joe*_*Joe 5 json amazon-sns aws-cli
如何aws cli在命令行中通过精确的 JSON 结构发送(而不是通过文件):
aws sns publish --topic-arn "arn:aws:sns:us-east-1:12345:myproject_serverlessscheduler_sns" --message '{"key1":"value1", "key2":"value2"}' --profile myprofile
Run Code Online (Sandbox Code Playgroud)
上面的 JSON 结构是直接在命令行中提供的正确结构吗?
您提供的 JSON 结构是在 AWS CLI for SNS 中传递 JSON 的正确方法。
我在我的测试环境上进行了测试,如下所示,并确认可以 100% 工作: