How to Implement AWS Lambda to run SQL against On-Prem MS SQL Server using Windows Authentication

0

Currently there is no plan to migrate on-prem SQL Server to RDS and there is a need to run SQL against On-Prem MS SQL Server table before triggering other process on AWS Cloud. Can anyone suggest how to implement AWS Lambda which can execute SQL against on-prem MS SQL Server using windows authentication. Thank you.

已提問 1 個月前檢視次數 322 次
1 個回答
1

Solution Architecture Diagram

solution

  1. Create a VPC in the AWS environment and configure a private subnet within it.

ℹ️ This private subnet will host the AWS Lambda function.

  1. Set up a Site-to-Site VPN connection between the on-premises network and the VPC.

ℹ️ This will allow the Lambda function to access the on-premises SQL Server securely.

  1. Create an AWS Lambda function that will execute the SQL queries against the on-premises SQL Server.

ℹ️ Ensure that the Lambda function is configured to run within the private subnet of the VPC.

  1. Store the SQL Server connection details, such as the server hostname, database name, and authentication credentials, in a secure storage service like AWS Secrets Manager.

ℹ️ Grant the necessary permissions to the Lambda function's execution role to access the secrets.

  1. In the Lambda function code, retrieve the SQL Server connection details from the secure storage, establish a connection to the on-premises SQL Server using the VPN, and execute the required SQL queries.

⚡ Create a VPC endpoint for AWS Secrets Manager within your VPC. This will allow the Lambda function running in the private subnet to securely access Secrets Manager without needing to route traffic through the internet or a NAT gateway.


Additional recommendation

  • Set up appropriate logging and monitoring mechanisms, such as AWS CloudWatch, to track the execution of the Lambda function, any errors or failures, and the overall performance of the SQL queries.
  • Establish a backup and disaster recovery strategy for the data stored in the on-premises SQL Server, either by replicating the data to a different location or using a cloud-based backup solution.
  • Regularly review and update the security measures, such as encryption and access controls, to ensure the confidentiality and integrity of the data stored in the on-premises SQL Server.
profile picture
專家
已回答 1 個月前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南