You have migrated an on-premise SQL Server database to an Amazon Relational Database Service (RDS) database attached to a VPC inside a private subnet. Also, the related Java application, hosted on-premise, has been moved to an Amazon Lambda function.
Which of the following should you implement to connect AWS Lambda function to its RDS instance?
- Use Lambda layers to connect to the internet and RDS separately
- Configure lambda to connect to the public subnet that will give internet access and use Security Group to access RDS inside the private subnet
- Use Environment variables to pass in the RDS connection string
- Configure Lambda to connect to VPC with private subnet and Security Group needed to access RDS
What’s your guess? Scroll below for the answer…
Configure Lambda to connect to VPC with private subnet and Security Group needed to access RDS – You can configure a Lambda function to connect to private subnets in a virtual private cloud (VPC) in your account. Use Amazon Virtual Private Cloud (Amazon VPC) to create a private network for resources such as databases, cache instances, or internal services. Connect your lambda function to the VPC to access private resources during execution. When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of the security group and subnet in your function’s VPC configuration. This is the right way of giving RDS access to Lambda.
Use Lambda layers to connect to the internet and RDS separately – You can configure your Lambda function to pull in additional code and content in the form of layers. A layer is a ZIP archive that contains libraries, a custom runtime, or other dependencies. Layers will not help in configuring access to RDS instance and hence is an incorrect choice.
Configure lambda to connect to the public subnet that will give internet access and use the Security Group to access RDS inside the private subnet – This is an incorrect statement. Connecting a Lambda function to a public subnet does not give it internet access or a public IP address. To grant internet access to your function, its associated VPC must have a NAT gateway (or NAT instance) in a public subnet.
Use Environment variables to pass in the RDS connection string – You can use environment variables to store secrets securely and adjust your function’s behavior without updating code. You can use environment variables to exchange data with RDS, but you will still need access to RDS, which is not possible with just environment variables.
Welcome to the best practice exams to help you prepare for your AWS Certified Developer Architect Associate exam.
- You can retake the exams as many times as you want
- This is a huge original question bank
- You get support from instructors if you have questions
- Each question has a detailed explanation
- Mobile-compatible with the Udemy app
- 30-days money-back guarantee if you’re not satisfied
We hope that by now you’re convinced!… And there are a lot more questions inside the course.
Happy learning and best of luck for your AWS Certified Developer Associate exam!
Who this course is for:
- Anyone who wants to practice the DVA-C01 AWS Certified Developer exam before taking the real one!
Can I download Practice Exams | AWS Certified Developer Associate 2021 course?You can download videos for offline viewing in the Android/iOS app. When course instructors enable the downloading feature for lectures of the course, then it can be downloaded for offline viewing on a desktop.
Can I get a certificate after completing the course?Yes, upon successful completion of the course, learners will get the course e-Certification from the course provider. The Practice Exams | AWS Certified Developer Associate 2021 course certification is a proof that you completed and passed the course. You can download it, attach it to your resume, share it through social media.
Are there any other coupons available for this course?You can check out for more Udemy coupons @ www.coursecouponclub.com
Disclosure: This post may contain affiliate links and we may get small commission if you make a purchase. Read more about Affiliate disclosure here.