- Newest
- Most votes
- Most comments
Yes, there is an Amplify CLI command that allows you to delete only the cloud resources without affecting your local codebase. The command you're looking for is amplify delete.
The amplify delete command provides several options that allow you to control what gets deleted:
-
amplify delete
- This will delete all the resources associated with your Amplify app in the cloud.
-
amplify delete --resource [resource-name]
- This will delete a specific resource in your Amplify app.
-
amplify delete --only-cloud
- This is the option you're looking for. It will delete only the cloud resources without affecting your local codebase.
To use the amplify delete --only-cloud command, follow these steps:
- Navigate to your project directory in the terminal.
- Run the following command:
amplify delete --only-cloud - This will prompt you to select the environment you want to delete the cloud resources from (e.g., dev, prod).
- Confirm the deletion, and Amplify will remove the cloud resources without touching your local codebase.
After running this command, your local codebase will remain intact, but the resources that were previously pushed to the cloud will be deleted. This allows you to keep your local testing environment while cleaning up the cloud resources when you're done experimenting.
Remember that if you later want to push your local changes to the cloud, you'll need to run amplify push to recreate the necessary cloud resources.
Relevant content
- asked 3 years ago
- asked 5 months ago
- AWS OFFICIALUpdated 4 years ago

I cant find an answer to this anywhere either. I would like to be able to disable my app in case the traffic gets too high.