【发布时间】:2021-01-18 06:55:45
【问题描述】:
有没有办法使用 AWS CLI 来修改 SNS 主题的属性? 我正在尝试为 SNS 主题启用加密,但此处提供的文档
只指定了2种方法:
- 使用 AWS 控制台
- 使用 Java AWS 开发工具包
【问题讨论】:
标签: amazon-web-services amazon-sns
有没有办法使用 AWS CLI 来修改 SNS 主题的属性? 我正在尝试为 SNS 主题启用加密,但此处提供的文档
只指定了2种方法:
【问题讨论】:
标签: amazon-web-services amazon-sns
这是您要查找的内容:
https://docs.aws.amazon.com/cli/latest/reference/sns/set-topic-attributes.html
--attribute-name (string)
A map of attributes with their corresponding values.
The following attribute applies only to server-side-encryption :
KmsMasterKeyId - The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom CMK. For more information, see Key Terms . For more examples, see KeyId in the AWS Key Management Service API Reference .
【讨论】:
使用set-topic-attribute 命令。
例子:
aws sns set-topic-attributes --topic-arn arn:aws:sns:us-west-2:123456789012:MyTopic --attribute-name KmsMasterKeyId --attribute-value arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias
您还可以使用 key id、key id arn 或只是属性值的别名。
【讨论】: