Using Console
Using CLI
<CIDR_BLOCK>
with the CIDR block range you want to use for your VPC.<VPC_ID>
with the ID of the VPC you created in step 2 and <SUBNET_CIDR_BLOCK>
with the CIDR block range you want to use for your subnet.<SECURITY_GROUP_NAME>
with the name you want to give your security group, <SECURITY_GROUP_DESCRIPTION>
with a brief description of the security group, and <VPC_ID>
with the ID of the VPC you created in step 2.<SECURITY_GROUP_ID>
with the ID of the security group you created in step 4 and <SUBNET_CIDR_BLOCK>
with the CIDR block range of the subnet you created in step 3.<ROLE_NAME>
with the name you want to give your execution role and trust-policy.json
with the file path to your trust policy document.<ROLE_NAME>
with the name of the execution role you created in step 6.<FUNCTION_NAME>
with the name of the Lambda function you want to update, <SUBNET_ID>
with the ID of the subnet you created in step 3, <SECURITY_GROUP_ID>
with the ID of the security group you created in step 4, and <ROLE_ARN>
with the ARN of the execution role you created in step 6.<FUNCTION_NAME>
with the name of the Lambda function you updated in step 8.These steps should remediate the misconfiguration “Lambda Should Have Access To VPC-only Resources” in AWS using AWS CLI.Using Python