amplify-cli: build failure on "CREATE_FAILED SNSRole"

Note: If your issue/bug is regarding the AWS Amplify Console service, please log it in the official AWS Amplify Console forum

Describe the bug I am getting a build failure on “CREATE_FAILED SNSRole”

I added Auth using “amplify auth add”, then i pushed using “amplify push”. I commited my latest changes to AWS CodeCommit. During the build it failed on

                                 # Starting phase: build
                                 # Executing command: amplifyPush --simple
2019-04-28T06:51:29.295Z [INFO]: # Getting Amplify CLI Cloud-Formation stack info from environment cache
2019-04-28T06:51:29.322Z [INFO]: # Start initializing Amplify environment: master
2019-04-28T06:51:29.324Z [INFO]: STACKINFO={
                                 "awscloudformation": {
                                 "AuthRoleName": "aws-amplify-20190316163924-authRole",
                                 "UnauthRoleArn": "arn:aws:iam::113026965814:role/aws-amplify-20190316163924-unauthRole",
                                 "AuthRoleArn": "arn:aws:iam::113026965814:role/aws-amplify-20190316163924-authRole",
                                 "Region": "us-west-2",
                                 "DeploymentBucketName": "aws-amplify-20190316163924-deployment",
                                 "UnauthRoleName": "aws-amplify-20190316163924-unauthRole",
                                 "StackName": "aws-amplify-20190316163924",
                                 "StackId": "arn:aws:cloudformation:us-west-2:113026965814:stack/aws-amplify-20190316163924/1d610510-484d-11e9-ab7c-0ad0021418ba"
                                 },
                                 "categories": {
                                 "auth": {
                                 "cognito91d36e32": {},
                                 "cognitobeb76591": {}
                                 }
                                 }
                                 }
                                 # Importing Amplify environment: master (amplify env import)
2019-04-28T06:51:37.178Z [INFO]: Successfully added environment from your project
2019-04-28T06:51:37.185Z [INFO]: # Initializing existing Amplify environment: master (amplify init)
2019-04-28T06:51:38.620Z [INFO]: Note: It is recommended to run this command from the root of your app directory
2019-04-28T06:51:40.934Z [WARNING]: - Initializing your environment: master
2019-04-28T06:51:41.290Z [WARNING]: ✔ Initialized provider successfully.
2019-04-28T06:51:41.518Z [WARNING]: - Updating resources in the cloud. This may take a few minutes...
2019-04-28T06:51:47.355Z [INFO]: 
2019-04-28T06:51:47.358Z [INFO]: UPDATE_IN_PROGRESS aws-amplify-20190316163924 AWS::CloudFormation::Stack Sun Apr 28 2019 06:51:42 GMT+0000 (UTC) User Initiated
2019-04-28T06:51:52.285Z [INFO]: 
2019-04-28T06:51:52.288Z [INFO]: CREATE_IN_PROGRESS authcognitoa948af67 AWS::CloudFormation::Stack Sun Apr 28 2019 06:51:47 GMT+0000 (UTC)
                                 CREATE_IN_PROGRESS authcognitoa948af67 AWS::CloudFormation::Stack Sun Apr 28 2019 06:51:49 GMT+0000 (UTC) Resource creation Initiated
2019-04-28T06:51:52.328Z [INFO]: 
2019-04-28T06:51:52.331Z [INFO]: CREATE_IN_PROGRESS aws-amplify-20190316163924-authcognitoa948af67-W9WQIC0ATZ2D AWS::CloudFormation::Stack Sun Apr 28 2019 06:51:48 GMT+0000 (UTC) User Initiated
2019-04-28T06:51:57.414Z [INFO]: 
2019-04-28T06:51:57.416Z [INFO]: CREATE_IN_PROGRESS SNSRole                                                     AWS::IAM::Role             Sun Apr 28 2019 06:51:56 GMT+0000 (UTC)
                                 CREATE_FAILED      SNSRole                                                     AWS::IAM::Role             Sun Apr 28 2019 06:51:56 GMT+0000 (UTC) cognitoa948af67_sns-role-master already exists in stack arn:aws:cloudformation:us-west-2:113026965814:stack/projectname-20190427215707-authcognitoa948af67-15ZQGBT9KRHJV/b71d7b40-697a-11e9-b512-067128db80fc
                                 CREATE_FAILED      aws-amplify-20190316163924-authcognitoa948af67-W9WQIC0ATZ2D AWS::CloudFormation::Stack Sun Apr 28 2019 06:51:56 GMT+0000 (UTC) The following resource(s) failed to create: [SNSRole].
2019-04-28T06:52:02.376Z [INFO]: 
2019-04-28T06:52:02.380Z [INFO]: CREATE_FAILED               authcognitoa948af67        AWS::CloudFormation::Stack Sun Apr 28 2019 06:51:59 GMT+0000 (UTC) Embedded stack arn:aws:cloudformation:us-west-2:113026965814:stack/aws-amplify-20190316163924-authcognitoa948af67-W9WQIC0ATZ2D/185465c0-6982-11e9-a600-0aeceae62d6e was not successfully created: The following resource(s) failed to create: [SNSRole].
                                 UPDATE_ROLLBACK_IN_PROGRESS aws-amplify-20190316163924 AWS::CloudFormation::Stack Sun Apr 28 2019 06:52:00 GMT+0000 (UTC) The following resource(s) failed to create: [authcognitoa948af67].
2019-04-28T06:52:07.289Z [INFO]: 
2019-04-28T06:52:07.292Z [INFO]: UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS aws-amplify-20190316163924 AWS::CloudFormation::Stack Sun Apr 28 2019 06:52:04 GMT+0000 (UTC)
...

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

Getting this a well. Not impressed so far with the framework and all the errors and issues it is generating

I think the issue should be reopened, there was a name clashwith another project I ran before, but one that had a project name completely different… the snsdev-dev automated name for a role should not be so prone to be replicated (probably because both projects had a dev environment?) It should be something more difficult to clash or let cloudformation create it for you , in my case this happened:

Event Type: create
Reason: snsdev-dev already exists in stack arn:aws:cloudformation``` 

I can’t get over my frustration with this framework. Every single error I run into is a well known issue that is asked multiple times with no helpful information.

It is even more insulting to constantly see “same issue, closing. Same issue, closing.” and all of the issues are dead, have no info, or just have more and more people piling onto this. Even worse when they’re closed after a pull request but I’m still having the issue.

amplify init && amplify add auth && amplify add api from a brand new repo already broke my amplify project. And i did the exact same thing a week ago with no problems. I have no idea where to begin to look

Looks like my issue was not not using amplify push after auth before amplify add api.

So: amplify init && amplify add auth && amplify push amplify add api && amplify push

I only believe this to be the case because this was the only way to avoid the create sns dev role error.