1
votes

Issue: New amplify project created throws this error:

Error: Resource Name: SNSRole (AWS::IAM::Role) Event Type: create Reason: snsdev-dev already exists in stack arn:aws:cloudformation:eu-west-1:

✖ 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

Amplify project created as follows:

# 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

Then the above error comes on the first push.

2

2 Answers

1
votes

Resource already exists error will be popped up if you are trying to create a AWS resource with same name that is already created through another stack and existing. Check for any duplicate stacks and delete them if not required. Else try to rename the resource

0
votes

The issue was with the hyphen in the project name.

Look at these two Github issues that deal with this issue:

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

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

I created another project without the hyphen to fix the issue.