1

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

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

✖ 资源推送到云端时出错

Resource is not in the state stackUpdateComplete 推送操作时出错:Resource is not in the state 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

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

4

2 回答 2

1

如果您尝试创建已通过另一个堆栈创建且现有的具有相同名称的 AWS 资源,则会弹出资源已存在错误。检查任何重复的堆栈并在不需要时将其删除。否则尝试重命名资源

于 2020-06-01T11:49:18.410 回答
0

问题在于项目名称中的连字符

看看这两个处理这个问题的 Github 问题:

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

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

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

于 2020-06-01T23:34:35.290 回答