I’m interested in better securing the RDS instances that Lambda accessing with Jets. I watched the introductory tutorial that is provided for jets, and two things stuck out to me:
- A database connection string with a plaintext password is used as an environment variable in Lambda to get an RDS connection.
- The lambdas are not launched in a VPC alongside the RDS instance by default; this means that the RDS instance is publicly accessible.
Both these things seem like bad practices, though I’m sure they were just shortcuts to cut down on video time. What’s the best way to mitigate these issues with Jets? I haven’t found anything in the docs.
I’m imagining the best way to go would be to remove public accessibility from RDS and allow my lambda to connect to the VPC the RDS instance is in via its role. Then I think I could remove the DB URL string in the environment variable. Does this sound the best approach, and, if so, how can I do this with Jets?
Documentation website: https://community.rubyonjets.com/