AWS security group inbound rule. allow lambda function

后端 未结 5 1457
闹比i
闹比i 2021-01-01 10:23

I run a service on my EC2 instance and I want to setup an inbound rule that only allows my lambda function to access it. The security group allows me to restrict access by a

5条回答
  •  执笔经年
    2021-01-01 11:15

    You can refer below articles to do the same,
    1. https://medium.com/@justanotherspyy/how-to-connect-your-lambda-function-securely-to-your-private-rds-instances-in-your-vpc-29789220a33
    2. https://medium.com/orchestrated/steps-to-secure-aws-serverless-lambda-part-1-a6e5d1b05f45

    The summary would be,
    1. Create a role for Lambda using below two policies,
    AWSLambdaBasicExecutionRole — provides CloudWatch logging.
    AWSLambdaENIManagementAccess — provides ENI description, creation, and deletion.
    2. Put lambda in the same VPC of EC2 and create a security group for the lambda function.
    3. Put this security group in EC2's security group's inbound rules.

提交回复
热议问题