question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cant remove API after removing all dependencies

See original GitHub issue

Describe the bug I want to remove my existing api with amplify remove api. It’s true that some of functions are using the API (Appsync and as a DDB storage). Therefore, I removed all related resources to the API from my functions. After doing that, I tried the remove the api again. I get the same error: Resource cannot be removed because it has a dependency on another resource

Amplify CLI Version 4.37.0

To Reproduce

  1. amplify add api.
  2. configure schema.
  3. amplify add function > configure resources > enable api and storage > choose the model you’ve created.
  4. amplify push
  5. amplify update function > configure resources > unselect api and storage
  6. amplify remove api
  7. Error: Resource cannot be removed because it has a dependency on another resource

Expected behavior After removing the depencies, ampify remove api should just work!

Desktop (please complete the following information):

  • OS: Windows

Additional context Is there a way to force delete the API perhaps with -force irregardless of dependencies? The purpose is so that I can drop the entire table and recreate them in order to truncate my tables.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
OsenLiucommented, Dec 14, 2020

I have the same issue. My amplify version is 4.39 & 4.34.

  1. add the storage access to the function
  2. remove storage access to the function
  3. remove storage with amplify storage remove The cli always say “Resource cannot be removed because it has a dependency on another resource”

I have to manually remove the storage in amplify-meta file and then can remove the storage.

1reaction
ammarkarachicommented, Jan 18, 2021

@nubpro Sorry on the delay will get back to you on this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Removing dependencies - Power Platform - Microsoft Learn
Dependencies sometimes can block operations. This article describes how dependencies can be removed.
Read more >
How to remove an uninstalled package's dependencies?
You can use the command apt-get autoremove . It will remove packages that are installed as automatic dependencies, but are not depended anymore....
Read more >
Error while removing project dependency in VS2010
When I tried to remove a dependency of a project, I am getting an error message like "The dependency was added by the...
Read more >
Troubleshoot dependency errors when deleting VPCs - AWS
I received a dependency error when I tried to delete my Amazon Virtual Private Cloud (Amazon VPC). How do I delete it?
Read more >
Removing metadata dependencies automatically when ...
Yes, that is a primary purpose of First- and Second-Generation Managed Packages; they will uninstall all components that were installed from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found