Amplify-cli: Attempt to delete @connection creates CF conflict

Created on 9 May 2019  路  2Comments  路  Source: aws-amplify/amplify-cli

Describe the bug
When trying to remove a @connection between 2 GQL types, the amplify push fails as the CF update attempts to remove the output from the stacks for the types before the dependency on the output is removed from the connection stack. This also happens if trying to remove the @searchable annotation, as the update attempts to remove the DynamoDB stream before the dependency on it in the searchable stack is removed.

To Reproduce
Steps to reproduce the behavior:

  1. Install amplify 1.6.7
  2. Set up 2 types with a @connection and push to AWS
  3. Remove the @connection links and push to AWS
  4. Push fails

Expected behavior
It should be possible to remove @connection and @searchable (or to completely delete a GQL type that has these annotations).

Additional context
Example CF error (resolver in Connection stack requires data source from GQL Type stack):
UPDATE_FAILED PreviewImage AWS::CloudFormation::Stack Thu May 09 2019 14:33:20 GMT+0100 (British Summer Time) Embedded stack xxxxxx was not successfully updated. Currently in UPDATE_ROLLBACK_IN_PROGRESS with reason: Export xxxx:GetAtt:PreviewImageDataSource:Name cannot be deleted as it is in use by xxxx-ConnectionStack-xxxxx

bug graphql-transformer review

Most helpful comment

There are 2 PR opens to handle the 2 scenarios, #1182 for removing @connection and #1140 for removing @searchable.

All 2 comments

There are 2 PR opens to handle the 2 scenarios, #1182 for removing @connection and #1140 for removing @searchable.

the fixes by @kstro21 has been merged and would be published in the next release - 1.6.10.

Was this page helpful?
0 / 5 - 0 ratings