-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems using jdbc-wrapper in Spring Boot native image to connect to RDS via IAM #1184
Comments
We investigated this issue a bit further, but this time from a different angle. Instead of building with native image, we tried to connect to the RDS instance via a jar deployment. This worked and you can find it on this branch. After that, we tried to get the native image setup to work and we made some progress. This takes many cycles because we need to update the There a few things we changed in the reproducible example:
We hope that having this working case without native image makes it easier to troubleshoot the issue. It would be awesome if we can figure out the issue and run the setup with Native Image :D. |
We can probably add reachability data. |
Hi @niek-dewit and @rickie, Thanks for reaching out and raising this issue. We'll take a look at this and keep you updated as we investigate. |
Just an update, I was unfamiliar with native image and reachability metadata, but I've been spending time this week familiarizing myself and am currently in the process of creating/testing our reachability metadata. We use a fair bit of reflection so there's a number of cases to test. I'll continue working on this next week. |
Describe the bug
To start with some context, we are creating a Spring Boot project with Spring Cloud Functions that uses GraalVM to build a native image and deploy this to AWS Lambda. Here it will connect with API Gateway and has to connect with an RDS instance using IAM authentication.
First of all we noticed that this library doesn't provide reachability metadata for GraalVM out-of-the-box yet, as seen here: https://www.graalvm.org/native-image/libraries-and-frameworks/.
This made us create a few extra config files to ensure the native image works as expected. However, now we have some problems with setting up the AWS advanced JDBC Wrapper to connect to Postgres RDS.
We tried following many different instructions from the docs. For example, this one and this one.
The problem is that we are not able to connect to RDS without any runtime issues. There are problems with packages missing and before connecting that we expect to be provided or done by the
jdbc-wrapper
. Sometimes we can prevent the problems by being creative and extending our Native image reflection setup. However, there is always a next error. To us, it feels like we are trying to make something work, that perhaps should work out of the box when starting to use this wrapper.Can you help us identify what is going wrong in our setup and how we can connect to RDS from our Lambda? Your help would be kindly appreciated.
Expected Behavior
We would expect the application to connect to the database.
Right now the logs mention Aurora in the logs as well, why we are not configuring that. Probably there is something going wrong there as well.
What plugins are used? What other connection properties were set?
IAM. And the connection properties
user
andwrapperPlugins
Current Behavior
We invoke the Lambda via API Gateway to trigger the lambda to start up. Then via CloudWatch we get the logs.
Please see the error logs in this file (from the reproduction case repository).
To summarize the errors we are currently experiencing problems with:
Reproduction Steps
Here is a link to a reproducible case in a repository: https://github.com/ExpressMe/aws-report
Please note that if you actually want to deploy it via the provided CDK files, you'll need to set the environment variables in
.env.dev
inapps/aws/
. The steps to reproduce are listed in the README.Possible Solution
Additional Information/Context
Some context on why we set things in our project up like this; we want to be able to do two things:
Besides our subproject
uppercase
we have an even simpler version of a lambda without database things that works like expected when we deploy it to AWS Lambda.If you have any further questions, please let us know what we can do to help. We would really like to get to the core of the issue such that we can connect to RDS 😄.
The AWS Advanced JDBC Driver version used
2.5.0
JDK version used
21.0.2-graalce
Operating System and version
Linux Ubuntu 22.04
The text was updated successfully, but these errors were encountered: