1

In the AWS Lambda service's console, there is a Configuration tab called Database proxies, shown here:

lambda

However, in the Terraform registry's entry for an AWS Lambda Function, there does not seem to be a place to define this relationship for my lambda. It's easy enough to add manually after I deploy the Lambda, but for obvious reasons this isn't optimal. It seems like using a DB proxy is a common enough use case for serverless architectures that there would be a way to do this with the resources I've referenced.

What am I missing?

EDIT: As of 9 months ago, this feature was not included in the AWS Provider, but I'm unsure of how to search upcoming nightly or perhaps dev releases of Terraform for this feature...

EDIT EDIT (from my comment below): the RDS, its proxy, the roles they use, the lambdas, and the vpc in which they sit all work as expected. if I go to the above screenshot in the lambdas I am deploying, I can Add database proxy just fine using the proxy I deployed with Terraform. There are no issues with the code, nor any errors. The problem is that having to manually add the Database Proxy to each Lambda I deploy defeats the purpose of using Terraform.

jtoberon
  • 8,706
  • 1
  • 35
  • 48
d8aninja
  • 3,233
  • 4
  • 36
  • 60
  • 2
    Probably you could achieve the same outcome with that proxy integration with lambda. You have to setup everything yourself (lambda in VPC, proxy, IAM role, etc). The proxy feature in AWS console is just a shortcut that does all these operations for you. – Marcin Mar 01 '22 at 02:13
  • @Marcin the only proxy integration with lambda I see is an api gateway related resource? i have everything deploying (Lambda, a VPC, all the security groups and subnets, RDS instance, the proxy DB, IAM Roles, everything), but linking the Lambda to the RDS Proxy is the last step. – d8aninja Mar 01 '22 at 02:22
  • 1
    There is no "linking" done. Proxy is setup to use IAM authorization to access it. In lambda's case this is IAM role that provides these permissions. Sadly you haven't provided any details about your proxy, iam role, vpc, lambda code, which would help determine why you have any problems. Same, you haven't described what is the actual issue with your code? Any errors while connecting to the proxy? – Marcin Mar 01 '22 at 02:26
  • @Marcin the RDS, its proxy, the roles they use, the lambdas, and the vpc in which they sit all work as expected. if I go to the above screenshot in the lambdas I am deploying, I can `Add database proxy` just fine using the proxy I deployed with Terraform. There are no issues with the code, nor any errors. The problem is that having to manually add the Database Proxy to each Lambda I deploy defeats the purpose of using Terraform. – d8aninja Mar 01 '22 at 02:46
  • @Marcin to which "proxy integration with lambda" are you referring in your first comment? – d8aninja Mar 01 '22 at 02:57

0 Answers0