Cannot remove function + attached resolver #15480
Labels
bug
Addresses a defect in current functionality.
service/appsync
Issues and PRs that pertain to the appsync service.
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v0.12.28
AWS provider v2.70.0
Affected Resource(s)
Description
Terraform correctly creates above resources and sets up implicit dependency from resolver to function, when pipeline_config is created. However due to AWS limitations of this relation, destroying those two resources at same run/deployment is resulting in a failure.
Before there are comments of 'did you try on 0.13' - no I haven't, that's a luxury I can't afford at this moment as infrastructure that I'm working on is big and mature, we have upgrade in roadmap but not anytime soon.
I'm looking for a solution or a workaround that will solve this, or at least will be solved once we upgrade.
Terraform Configuration Files
Note: incomplete and dummy part of code, but should give an idea of a problem
Panic Output
Error: Error deleting AppSync Function .....: BadRequestException: Cannot delete a function which is currently used by a resolver. Resolver type: Query, field: ....
Error: BadRequestException: Data source is still in use by functions: [....]
Expected Behavior
There has to be reversed dependency when it comes to destroying/updating. Resolver MUST be updated/removed before function, this is AWS requirement.
On creation however it stays as it is right now, function has to be created before it is attached to resolver.
Actual Behavior
Because of implicit dependency, on destroy function is deleted first, and it can't as it's attached to resolver configuration. Adding explicit dependency results in cycle error.
Steps to Reproduce
Create any resolver and function in pipeline_config setup, then remove them from hcl code and run terraform to destroy them.
The text was updated successfully, but these errors were encountered: