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.

[appsync]: Data Source breaking change

See original GitHub issue

I just tried the latest CDK v1.60.0 and changed these lines of code in my existing deployment from this:

    const lambdaApiResolverDataSource = graphQlApi.addLambdaDataSource(
      'LambdaApiResolverDataSource',
      `Resolves GraphQL requests for ${product}`,
      lambdaApiResolverFunction
    );

to this:

    const lambdaApiResolverDataSource = graphQlApi.addLambdaDataSource('LambdaApiResolverDataSource', lambdaApiResolverFunction, {
      description: `Resolves GraphQL requests for ${product}`
    });

When the deployment ran, it failed with this:

AppSyncConstructGraphQLLambdaApiResolverDataSourceBAD1E2A7
CREATE_FAILED
Data source with name LambdaApiResolverDataSource already exists (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException; Request ID: 45ade8da-9b90-432e-9620-0de300aaf18a; Proxy: null)

This is for an existing AppSync deployment. This code was working in the previous release I had (v1.59.0).

Reproduction Steps

As described above.

What did you expect to happen?

The deployment should have succeeded.

What actually happened?

The deployment failed with:

AppSyncConstructGraphQLLambdaApiResolverDataSourceBAD1E2A7
CREATE_FAILED
Data source with name LambdaApiResolverDataSource already exists (Service: AWSAppSync; Status Code: 400; Error Code: BadRequestException; Request ID: 45ade8da-9b90-432e-9620-0de300aaf18a; Proxy: null)

Environment

  • CLI Version : v1.60.0
  • Framework Version:
  • Node.js Version: v12.4.0
  • OS : Deployment ran on CircleCI
  • Language (Version): Typescript 3.9.7

Other


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
BryanPan342commented, Aug 20, 2020

@andrestone thanks for the initiative in looking into this

@asnaseer-resilient thanks for the feedback! I apologize, I should have written a better commit description highlighting the potential effects. The AppSync module a couple of months ago used to be a monolithic single file with virtually no unit tests. Currently, I have been trying to clean up the library and make sure it functions similarly to the rest of the CDK.

I definitely keep this in mind as I make changes in the future!

2reactions
asnaseer-resilientcommented, Aug 20, 2020

Thanks for tracking it down - and I agree it should definitely have appeared in the “Breaking Changes”.

We have 3 APIs that have been deployed to live and a web app that uses them. This breakage meant that I had to delete the 3 APIs and then re-deploy them which caused their corresponding GraphQL endpoints to change. I then had to update my web app with the new endpoints and re-deploy that.

I realise this is an evolving library and really appreciate all the work everyone has put into this. Many people now use this in production and therefore it would be really appreciated if any changes could be made such that they do not imply a re-deployment of resources - I know this is hard but just something to think about.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conflict Detection and Sync - AWS AppSync
When an AWS AppSync mutation changes an item in a versioned data source, a record of that change will be stored in a...
Read more >
How to handle multiple AWS AppSync service versions
Yes, the best practice, as of now, would be to create a new API. If you must introduce breaking changes to the API...
Read more >
@aws-cdk/aws-appsync-alpha - npm
These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while...
Read more >
appsync-router - PyPI
WARNING - Version 4.0.0 is a breaking change from version 3. ... This allows for cleanly creating a single AWS Lambda datasource without...
Read more >
AWS AppSync Developer Guide - Amazon S3
It is subject to change. If you are building a GraphQL API, there are some concepts you need to know, such as schema...
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