Describe the bug
I created fresh project and add graphql api protected by auth. And created dev environment.
When I try to amplify push I get following error
The following resource(s) failed to create: [SNSRole].
snsdev-dev already exists in stack
Amplify CLI Version
4.17.2
To Reproduce
npx create-react-app test-app --use-npm --template typescriptamplify init with environment devamplify add auth everything defaultamplify add api use default simple schemaamplify pushExpected behavior
Its completely fresh project. I should be able to create dev environment.
Desktop (please complete the following information):
Additional context
It works when I change my environment name from dev to testdev
basically dev environment is now forever reserved in single region.
Closing as duplicate of https://github.com/aws-amplify/amplify-cli/issues/3687
Don't think this is a hyphen thing (as described in #3687). My problem is that I have an existing amplify project using auth with env dev. I create a totally different amplify project that uses auth and I also want set it up with an environment call dev. When I 'amplify push' (after amplify add auth), I get the following error:
CREATE_IN_PROGRESS amplify-team-todo-dev-94024-authteamtodobb63675f-C7UVP7IRKUVI AWS::CloudFormation::Stack Sun Jun 14 2020 10:38:34 GMT-1000 (Hawaii-Aleutian Standard Time) User Initiated
â ™ Updating resources in the cloud. This may take a few minutes...
CREATE_FAILED amplify-team-todo-dev-94024-authteamtodobb63675f-C7UVP7IRKUVI AWS::CloudFormation::Stack Sun Jun 14 2020 10:38:41 GMT-1000 (Hawaii-Aleutian Standard Time) The following resource(s) failed to create: [SNSRole].
CREATE_FAILED SNSRole AWS::IAM::Role Sun Jun 14 2020 10:38:40 GMT-1000 (Hawaii-Aleutian Standard Time) snsdev-dev already exists in stack arn:aws:cloudformation:us-west-2:768046050057:stack/amplify-amplify-notetaker-dev-111546-authamplifynotetaker72ca287f-TV8AQJ29WYR2/9ef8c9a0-7d03-11ea-836a-0a8077ae26ee
CREATE_IN_PROGRESS SNSRole AWS::IAM::Role Sun Jun 14 2020 10:38:40 GMT-1000 (Hawaii-Aleutian Standard Time)
I think I'm missing something here. Why can't I have multiple (totally separate) apps that use similar environment names (like test, dev, prod) and amplify auth? Can you show me how to do this (without creating crazy unique env names for each app)?
Thanks
@BarbaraPruz
Can you show me how to do this (without creating crazy unique env names for each app)
I've been hacking at this for a few hours now and honestly it just seems there is no way around it. I've actually removed the back end build script from my yaml file under the CI build settings, and just do that manually. Being fair, I am _only_ using Amplify for Auth and Hosting. I did originally have it setup for Functions and a Rest API but I removed all of that and transitioned to Serverless instead.
I think this tool has a lot of potential but honestly, it's causes more pain than it gives back in convenience that you're better just writing your won SAM/CF templates with Serverless and write plugins to auto deploy apps to CI/CD yourself.
Most helpful comment
@BarbaraPruz
I've been hacking at this for a few hours now and honestly it just seems there is no way around it. I've actually removed the back end build script from my yaml file under the CI build settings, and just do that manually. Being fair, I am _only_ using Amplify for Auth and Hosting. I did originally have it setup for Functions and a Rest API but I removed all of that and transitioned to Serverless instead.
I think this tool has a lot of potential but honestly, it's causes more pain than it gives back in convenience that you're better just writing your won SAM/CF templates with Serverless and write plugins to auto deploy apps to CI/CD yourself.