【问题标题】:Using AWS CLI to enable encryption for SNS topic使用 AWS CLI 为 SNS 主题启用加密
【发布时间】:2021-01-18 06:55:45
【问题描述】:

有没有办法使用 AWS CLI 来修改 SNS 主题的属性? 我正在尝试为 SNS 主题启用加密,但此处提供的文档

只指定了2种方法:

  1. 使用 AWS 控制台
  2. 使用 Java AWS 开发工具包

【问题讨论】:

    标签: amazon-web-services amazon-sns


    【解决方案1】:

    这是您要查找的内容:

    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 .
    

    【讨论】:

      【解决方案2】:

      使用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 或只是属性值的别名。

      【讨论】:

        猜你喜欢
        • 2020-10-06
        • 2015-05-29
        • 2022-09-28
        • 1970-01-01
        • 2023-01-29
        • 2021-12-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多