I have a Lambda in my VPC that needs to access DynamoDB. I have a VPC Endpoint setup for this, finally got it to work, but am questioning the setup.
- Lambda is running in my private subnet.
- The subnet has a route table:
- Destination: 10.153.32.0/21
Target: local - Destination: pl-02cd2c6b (com.amazonaws.us-east-1.dynamodb, 52.94.0.0/22, 52.119.224.0/20)
Target: (my VPC Endpoint) - Destination: 0.0.0.0/0
Target: (my NAT Gateway)
- Destination: 10.153.32.0/21
- My VPC Endpoint is associated with the above route table (and a few others), hence the #2 route.
- And I added the following Network ACL Inbound Rule
- Port range 1024 - 65535
- CIDR blocks
52.94.0.0/22
and52.119.224.0/20
- ALLOW
What concerns me is that Network ACL rule. I added it after reading this comment.
I'm wondering if I need that rule, or if maybe something else is wrong? I was surprised I had to add it because that SO comment was the only place that mentioned it.
It feels fairly safe to add since those CIDRs should be safe to allow since they are specifically for DynamoDB. But I'm assuming I'll have to keep an eye out for changes to those ranges.
EDIT: I also tried updating my lambda's security group outbound rules, to allow all ports with a destination of pl-02cd2c6b
, but that didn't work.