Closed chessbyte closed 1 year ago
Add aws-sdk
to your dependencies, Node.js 18 image has AWS SDK v3 not v2 (the one the exception is about) bundled.
Using aws-sdk v2 now generates a warning:
NOTE: The AWS SDK for JavaScript (v2) will be put into maintenance mode in 2023.
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
Gently ping @ffxsam, are you still working on #89?
@vicary Unfortunately this isn't something I have time for these days. I have my own copy of this code that I use, I just don't have the time to update it with Jeremy's changes. I'll attach the full code below and anyone else is welcome to reconcile the two pieces of code.
Off the top of my head, some important things to note:
AWS
instance into data-api-client, I believe to support folks wanting to use this with X-Ray. Obviously that whole mechanism will not work with AWS SDK v3, but that's also a breaking change. I don't have publish permissions, so Jeremy will have to do a major version bump so we don't mess folks up.Thinking about this now, it's probably easier to just start with the code on main
and add the v3 changes. 🙂 They're not that complicated, it's just a matter of swapping out the SDK calls.
Full index.js code below:
Further recommendations for Jeremy: Maybe we sunset this library, archive it, modify the README? Seems like AWS is not supporting Data API going forward (w/ RDS Proxy being the new guy in town).
@ffxsam We use AppSync with Aurora Serverless v1 and they are only pieced together with data API.
Although TBH I am not sure what they're doing by launching Aurora Serverless V2 without data API, while actively pushing for Amplify.
If you are sunsetting this, what would be the best alternative for our Lambda + TypeORM resolvers in AppSync?
@vicary As I understand it, RDS Proxy is the intended replacement for Data API, though I've done zero research on it, so I can't give any advice there!
I seem to recall looking into TypeORM some time ago, but I don't remember if there was a driver to make it connect to RDS Data API.
EDIT: Ahh, this was my issue: https://github.com/typeorm/typeorm/issues/6667
@ffxsam TypeORM driver supports the type of "aurora-mysql"
and "aurora-postgres"
, which I believe uses typeorm-aurora-data-api-driver under the hood.
Until ArsenyYankovsky/typeorm-aurora-data-api-driver#148 is resolved, sunsetting this one before they could maybe migrate to the built-in data api in v3, leaves us no viable alternatives but to spin up an RDS Proxy (for Lambda) in parallel with Data API (for AppSync RDS resolvers).
IMO RDS Proxy is less of an attractive choice because it adds extra costs upfront (with minimum charges and Data API is free), and running two similar components in parallel also adds unnecessary maintenance cost in the long run.
Sorry for the ranting, but please hold on until we have a choice.
We're simply abandoning this library, not removing it or anything. I've posted the changes to make it work with AWS JS SDK v3. As soon as someone merges that with the latest main
branch, Jeremy can publish, and that'll probably be the last update. The library will continue to work indefinitely.
@ffxsam We use AppSync with Aurora Serverless v1 and they are only pieced together with data API.
Although TBH I am not sure what they're doing by launching Aurora Serverless V2 without data API, while actively pushing for Amplify.
If you are sunsetting this, what would be the best alternative for our Lambda + TypeORM resolvers in AppSync?
With the sad news that this is abandoned we built a "replacement" @vicary , to use with our Aurora Serverless V1 instances.
It works as a native knex
instance with teh code from data-api-client included. We also updated it to use AWS SDK v3 to get rid of that annoying warning from teh AWS SDK...
See if it suits your needs: https://www.npmjs.com/package/@qvalia/knex-aws-data-api
We'll keep it up to date, and update as newer knex
versions are coming out, at least as long as we'll figure out where AWS is heading with Data-API...
@QAnders my team is on the move to kysely, will definitely keep an eye on knex for future greenfield contracts.
@chessbyte @vicary @ffxsam Hello, in Lambda from NodeJS v14 to v18, how have I to rewrite it? (data-api-client 1.3.0 + dependencies AWS SDK3)
const data = require('data-api-client')({ secretArn: 'xxxx', resourceArn: 'yyy', database: 'zzz', engine: 'pg' });
Thank you!
Resolved!
Trying to convert a Lambda from NodeJS v14 to v18, running into the following issue:
Looks like https://github.com/jeremydaly/data-api-client/pull/89 is trying to upgrade AWS JavaScript SDK v3, but there has been no activity on it in ~18 months.