本文介绍了拥有AWS SNS时无法更新cloudformation堆栈:主题资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个cloudformation模板,该模板创建一个SNS :: Topic和其他资源。现在的问题是,当我尝试更新堆栈时,它失败并显示以下错误

I have create a cloudformation template that creates one SNS::Topic and bunch of other resources. Problem now is that when i try to update the stack, it fails with the following error

"Update to resource type AWS::SNS::Topic is not supported"

堆栈策略为:

{
  "Statement" : [
    {
      "Effect" : "Deny",
      "Action" : "Update:*",
      "Principal": "*",
      "Resource" : "*",
      "Condition" : {
        "StringEquals" : {
          "ResourceType" : ["AWS::SNS::Topic", "AWS::EC2::Subnet"]
        }
      }
    },
    {
      "Effect" : "Allow",
      "Action" : "Update:*",
      "Principal": "*",
      "Resource" : "*"
    }
  ]
}

CF模板为

{
  "AWSTemplateFormatVersion": "2010-09-09",
  "Description": "......",
  "Resources": {
    "MySNSTopic":{
      "Type":"AWS::SNS::Topic",
      "Properties":{
        "DisplayName": "",
        "Subscription": [ ],
        "TopicName": { "Fn::Join": [ "-", [ "Simple", "sns", "topic" ] ] }
      }
    }
  }

我是否可以更改任何内容(甚至是可破解的),以使aws完成aws更新堆栈而无需删除/修改sns_topic?

Is there anything (even hackable) that i can change to let aws complete the aws update stack without deleting/modifying sns_topic?

推荐答案

我相信错误消息不支持更新资源类型AWS :: SNS :: Topic 抱怨您的问题权限,但有关CloudFormation模板用于SNS主题的限制。

I believe the error message Update to resource type AWS::SNS::Topic is not supported is not complaining about your permissions, but about the limitations of CloudFormation templates for SNS Topics.

指出以下内容:

创建Amazon SNS主题后,无法更新其
属性通过使用AWS CloudFormation来实现。您可以使用AWS管理控制台修改Amazon SNS
主题。

After you create an Amazon SNS topic, you cannot update its properties by using AWS CloudFormation. You can modify an Amazon SNS topic by using the AWS Management Console.

相反,您可以尝试添加新主题,将客户端切换为使用新主题,然后删除旧主题。如果您偏执狂,可以在单独的更新中进行。

Instead, you might try adding a new topic, switching clients to use the new topic, then deleting the old topic. If you are paranoid, you could do those in separate updates.

这篇关于拥有AWS SNS时无法更新cloudformation堆栈:主题资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 07:26