- Newest
- Most votes
- Most comments
When managing egress traffic in AWS, you have several tools at your disposal, each with specific use cases and advantages:
AWS-managed prefix lists are sets of IP address ranges for AWS services maintained by AWS. These are ideal when you need to reference IP addresses used by AWS services like S3, DynamoDB, CloudFront, and others. You cannot create, modify, share, or delete these prefix lists. They're particularly useful when configuring security groups or other network controls within a VPC, ensuring your network configurations are always up-to-date with the current IP ranges used by AWS services. This reduces administrative overhead and aligns with AWS security best practices.
Customer-managed prefix lists allow you to define and maintain your own sets of IP address ranges. These are beneficial when you have specific IP ranges that you frequently reference across multiple resources. Instead of hardcoding these IP addresses in various places, you can create a centralized prefix list and reference it wherever needed. This promotes consistency and simplifies management. You can also share these prefix lists with other AWS accounts, enabling collaborative IP address management across teams or organizations.
Both types of prefix lists can be referenced in:
- Security group rules
- Route tables
- AWS Network Firewall rule groups
- Transit gateway route tables
- Other AWS resources
Network Firewall integration with prefix lists is particularly powerful. When you configure a rule group that references a prefix list, Network Firewall automatically keeps the associated rules up-to-date. It creates an IP set object corresponding to the prefix list and manages references to it. The Network Firewall orchestration engine works with both AWS-managed and customer-managed prefix lists to automatically refresh IPs and apply updates to the stateful firewall engine.
When deciding which approach to use:
-
Use AWS-managed prefix lists when you need to reference official AWS service IP ranges that are automatically maintained by AWS.
-
Use Customer-managed prefix lists when you have your own set of IP ranges that you need to reference consistently across multiple resources, especially if these ranges might change over time.
-
Use VPC Endpoints when you want to privately connect your VPC to supported AWS services without requiring an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection. This provides enhanced security and lower latency for accessing AWS services.
-
Manual use of ip-ranges.json might be necessary for very specific use cases or automation scenarios, but generally, the managed prefix lists provide a more integrated and maintainable solution.
For optimal security and efficiency, you might use a combination of these approaches. For example, use VPC Endpoints for private connectivity to AWS services, while using prefix lists in your security groups and Network Firewall rules to control traffic based on IP ranges.
Sources
Keep your firewall rules up-to-date with Network Firewall features | AWS Security Blog
Consolidate and manage network CIDR blocks with managed prefix lists - Amazon Virtual Private Cloud
Customer-managed prefix lists - Amazon Virtual Private Cloud
AWS-managed prefix lists - Amazon Virtual Private Cloud
Optimize AWS infrastructure management with prefix lists - Amazon Virtual Private Cloud
A good mental model:
AWS-managed prefix lists – Best for AWS services like S3, DynamoDB, etc. They auto-update, so you don’t have to manage IP changes manually.
Customer-managed prefix lists – Ideal for your own CIDR sets (on-prem networks, partner IP ranges) that you want to centrally manage and reuse.
ip-ranges.json – Gives you raw AWS IP data, but you must write automation to consume and update rules — powerful but higher maintenance.
VPC Endpoints – More about keeping traffic private & cost-efficient (no NAT gateway data charges), not just IP control.
In most cases, VPC Endpoints + AWS-managed prefix lists give the best security & maintenance balance, while customer-managed prefix lists handle custom network ranges.
Relevant content
asked 6 years ago
