Can't delete amplify app from amplify dashboard - aws-amplify

I Can't delete app_name app from the dashboard
Can't delete app_name app: Removing backend envs for app XXX failed
I deleted an associated S3 bucket & CloudFormation manually.
I've tried everything and I can't delete an app

open AWS CloudShell and run cmd: aws amplify delete-app --app-id <your_app-id>
you can find amplify app id at amplify app detail

Try to use AWS CLI and either :
run command "aws amplify delete-app" (you will need appid) or
run command "aws amplify delete-backend-environment (you will need appid and environment name) and after that try to delete the app by using console again.

It appears that you've been having an issue distinct from, but related to this one: AWS Amplify: How to delete the environment, when resources are already partially deleted?
In your case, you mention that you've deleted the S3 bucket & CloudFormation stack associated with the amplify app manually.
As of 9/26/2022 Amplify released an update that fixes issues deleting apps/backends, including issues where the s3 bucket and cloudformation stack was already deleted as you mention you have done.

Related

Missing aws-exports file while loading existing AWS Amplify project onto local computer

When running react app which has AWS Amplify, Module not found: Error: Can't resolve './aws-exports' in .. error is coming.
Hi! Here is an overview of the problem and what I have tried so far:
My partner created a new AWS Amplify project which I am now trying to load onto my computer. I logged in with the same root credentials but created a new local user onto my computer.
I then ran amplify init, amplify pull, and amplify push.
However, when I run my react app, I get the error that they can't resolve ./aws-exports in my directory.
I think a possible issue is that I put the source dir for amplify init as my directory, not as the src folder inside - but I don't know how to change that (I am not sure how to use amplify update for this).
Are there any other solutions people have tried too?
Appreciate the help, thank you!

Firebase trouble when initializing CLI to deploy a react app

I keep getting the error below:
? Are you ready to proceed? Yes
? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to confirm your choices. Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option: Use an existing project
Error: Failed to list Firebase projects. See firebase-debug.log for more info.
PS C:\Users\xxxxxlinked-in>
I have tried everything I can find on StackOverflow:
firebase login will log me in.
I have also done the firebase login --reauth one and also just reinstalling it npm install -g firebase-tools.
Its just when I go to use an existing project.
If it helps to know, I keep gettin another error when uing this command firebase projects:list.

Where does amplify grab the value of `amplify env pull <multi-env> --restore` from?

In the documentation:
amplify env pull –restore
Pulls your environment with the current
cloud environment. Use the restore flag to overwrite your local
backend configs with that in the cloud.
My question is, where exactly the cloud at?? The problem that I am having now, is that whenever I do amplify env pull <multi-env-name> --restore, it is grabbing a different value on my amplify\.backend\amplify-meta.json compared to running amplify init.
What I initially did is I mistakenly created and pushed an amplify auth, and then I updated it to a new auth, pushed it, and published it. Somehow, right now whenever I do amplify env pull <multi-env-name> --restore, it is grabbing the old auth value. If they say the restore flag is to overwrite your local backend configs with that in the cloud, my configs in the cloud should be the last one that I updated(pushed).
Alright, I figured it out. It is in the S3 Deployment Bucket of whatever you set your DeploymentBucketName is, in the amplify-meta.json. And inside that bucket, you will find #current-cloud-backend.zip. So, amplify env pull <multi-env-name> --restore is fetching it from there. You basically can update that file with whatever you want to. But, it would be safe if you get it from amplify init command, and it will create a set of file in your project /amplify/ directory. Zip that file, and update it. Be sure to make a backup of your #current-cloud-backend.zipin the S3.

"Error: Permission denied" when running firebase init and choosing database

So I’m testing out the CLI today and firebase init with db/hosting selected, and choosing to create a new project, always says Error: Permission denied..
sudo firebase init didn’t help.
firebase-tools version 3.0.3 on OS X 10.11.5.
firebase init
You're about to initialize a Firebase project in this directory:
/Users/splaktar/Git/tmp
Before we get started, keep in mind:
* You are initializing in an existing Firebase project directory
? What Firebase CLI features do you want to setup for this folder? Database: Deploy Firebase Realtime Database Rules
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? What Firebase project do you want to associate as default? [don't setup a default project]
=== Database Setup
Firebase Realtime Database Rules allow you to define how your data should be
structured and when your data can be read from and written to.
? What file should be used for Database Rules? database.rules.json
Error: Permission denied.
I've tried the answers here but they did not help. Is this just a bug in the firebase-tools?
I have the same issue and this is how I fixed it.
run firebase init
Deselect ❯◯ Database: Deploy Firebase Realtime Database Rules
Go through other steps to setup the initial app, selecting the default for each should work just fine.
run firebase serve
Hope that helps.
Sometimes it could happen when .firebaserc file exists.
Remove .firebaserc file and reattempt firebase init.
I was with the same problem, but I was not accessing the right account.
After accessed the right account, I created a new project and run "firebase list" (before this not happened) and my new project was there.
This solved my problem.
You need to have Owner or Editor IAM permission on the GCP project to use firebase init command.
The firebase init command initializes/enables the project to use Cloud Functions/Hosting etc for Firebase. Owners/Editors have higher permissions that allow APIs to be enabled etc.
it is a first-time task when you starting the development, and then init command can be avoided if you have set up your cloud functions code in VCS for multiple developers or you.
i.e, Usually after writing code, you will replicate the project to other developers, who will then also write code and use firebase use yourprojectid further.

Firebase "Run firebase use default to activate project APP_NAME"

It was successfully when deployed first time, now im trying to deploy again, shows an error:
Run firebase use default to activate project MY_APP_NAME
Error:
No project active, but a project alias is available.
When you select a project during firebase init, an alias called default is created for you. To create a new alias, run:
firebase use --add
Then Firebase CLI will ask you
Which project do you want to add? (Use arrow keys)
This command allows you to select a Firebase project and give it a named alias. Alias definitions are written to a .firebaserc file inside your project directory.
At first should firebase use to make default alias.
After firebase use default to use default.
Then firebase deploy yahoo.. you can deploy
If you run firebase use it should show you an interactive prompt to help you set the active project.
When this is run, it creates a mapping between the directory it was run in and which project / alias you selected, so if you moved the directory the firebase.json file is situated in the previous link may have been severed.
Use... firebase use project-ID......
Example:( firebase use rent-1234h)..after this
type firebase use
hope this will work
You may need to run commands firebase login and firebase init again before doing firebase deploy it solved problem in my case.
I also needed to update npm and node.
Please logout from firebase using terminal and try to login in again. This fixed the same issue I was facing.
Use following syntax,
firebase logout
firebase login
firebase use default
We are working with CircleCi and this is the way deployment command looks:
- run:
name: Deploy to Firebase
command: ./firebase deploy --token $FIREBASE_TOKEN --force --project production
Note the --project production flag , "production" is firebase project alias.
In my case firebase logout and login again by firebase login works.
I have the same problem - want to switch project alias to staging after pull my code repo to new machine. I have another project on firebase and logged in the same account as in this project, but error appears:
Error: No project active, but project aliases are available.
and
Error: Invalid project selection, please verify project staging exists
and you have access.
Verify that in .firebaserc file project alias exist and it tagets to correct project in your account.
In .firebaserc get your project name you want to build
Here I got 2 projects name, 1 default for dev env, 1 prod for production env
{
"projects": {
"default": {dev_project_name},
"prod": {production_project_name}
}
}
when you run firebase deploy add arg --project {project_name}
Deploy to production env
firebase deploy --only functions --project prod
Deploy to development env
firebase deploy --only functions --project default

Resources