代码之家  ›  专栏  ›  技术社区  ›  stayingcool

snsdev dev已存在于堆栈中

  •  0
  • stayingcool  · 技术社区  · 6 年前

    问题: 创建的新放大项目引发以下错误:

    错误: 资源名称:SNSRole(AWS::IAM::角色) 事件类型:创建 原因:snsdev dev已存在于堆栈中arn:aws:cloudformation:eu-west-1:

    –将资源推送到云时出错

    资源不处于stackUpdateComplete状态 推送操作期间出错:资源未处于stackUpdateComplete状态

    放大创建的项目,如下所示:

    # mkdir react-rds
    # cd react-rds
    
    # amplify init
    ? Enter a name for the project react-rds
    ? Enter a name for the environment dev
    ? Choose your default editor: Visual Studio Code
    ? Choose the type of app that you're building javascript
    Please tell us about your project
    ? What javascript framework are you using react
    
    ⠙ Initializing project in the cloud...
    Your project has been successfully initialized and connected to the cloud!
    
    # amplify add auth
     Do you want to use the default authentication and security configuration? Default configuration
     Warning: you will not be able to edit these selections. 
     How do you want users to be able to sign in? Username
     Do you want to configure advanced settings? No, I am done.
    
    Successfully added resource reactrds0xxxbxde locally
    
    
    # amplify push
    ? Are you sure you want to continue? Yes
    â ¼ Updating resources in the cloud. This may take a few minutes...
    
    CREATE_FAILED      SNSRole                                                         AWS::IAM::Role             Sun May 31 2020 16:35:24 GMT+1000 (Australian Eastern Standard Time) snsdev-dev already exists in stack arn:aws:cloudformation:eu-west-1:4711111:stack/amplify-react-amplified-dev-12110-authreactamplifiedc7111f-1TOaaaaBPI1/e9xxxxx0-9fxx-11ex-97xx6-0acxxxxxee0
    CREATE_FAILED      amplify-react-rds-dev-163108-authreactrds011de-1PHaaaaaWIJ AWS::CloudFormation::Stack Sun May 31 2020 16:35:24 GMT+1000 (Australian Eastern Standard Time) The following resource(s) failed to create: [SNSRole].
    
    ✖ An error occurred when pushing the resources to the cloud
    
    Resource is not in the state stackUpdateComplete
    An error occured during the push operation: Resource is not in the state stackUpdateComplete
    

    然后在第一次推送时出现上述错误。

    0 回复  |  直到 6 年前
        1
  •  1
  •   Saiku    6 年前

    如果您试图创建一个具有相同名称的AWS资源,并且该资源已经通过另一个堆栈创建并存在,则会弹出“资源已存在”错误。 检查是否存在任何重复堆栈,如果不需要,请删除它们。否则请尝试重命名资源

        2
  •  0
  •   Community Mohan Dere    6 年前

    这个 问题 连字符 项目名称

    看看这两个Github问题:

    https://github.com/aws-amplify/amplify-cli/issues/3879

    https://github.com/aws-amplify/amplify-cli/issues/3687

    我创建了另一个没有连字符的项目来解决这个问题。