ARN controls authorization
VPC Endpoint controls network routing
These are completely different layers.
Let’s say your EC2 instance calls SQS:
EC2 → sqs.us-east-1.amazonaws.com
Even if:
- You use the correct ARN
- IAM permissions are correct
The traffic still:
- Leaves your VPC
Goes through:
- Internet Gateway OR
- NAT Gateway
- Travels over public AWS endpoints
Even though it's inside AWS backbone, it's still using public endpoints.
Now:
EC2 → Private ENI inside VPC → SQS
Traffic:
- Never goes to internet
- Never needs NAT Gateway
- Never needs public IP
- Stays fully private
If your subnet is fully private:
- No IGW
- No NAT
- No public IP
Your EC2 cannot reach service SQS/SNS/SSM etc. at all without:
- NAT Gateway + IGW OR
- Interface Endpoint (Without NAT and IGW)
So the Interface endpoint enables connectivity in fully private networks.
Without endpoint:
- Your subnet must have outbound internet access.
With endpoint:
- You can remove NAT completely.
- Block all outbound internet traffic.
- Only allow traffic to specific AWS services.
Much tighter security boundary.
Interface endpoints support endpoint policies.
Example:
{
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "sqs:SendMessage",
"Resource": "arn:aws:sqs:us-east-1:123456789012:my-queue"
}
]
}
Now even if IAM allows more, the endpoint itself restricts what can pass through.
This gives network-level authorization filtering.
You cannot do this with just ARN + IAM alone.
In regulated industries (banking, healthcare):
Rules may require:
- No internet connectivity
- No public endpoints
- Private routing only
Interface endpoints satisfy those requirements.
NAT Gateway is expensive.
If you only need AWS service access (SQS, SSM, SNS, etc.):
You can:
- Remove NAT
- Use interface endpoints
For high-traffic systems, this can save serious money.
If:
- Your subnet already has NAT
- You are OK with outbound internet access
- No strict compliance requirements
- Low security sensitivity
Then you may not need it.
Small projects often skip it.
Private EKS cluster:
- No public subnets
- No NAT
- No outbound internet allowed
Pods need to:
- Pull images from ECR
- Read secrets
- Send SQS messages
- Register with SSM
Without interface endpoints?
❌ Not possible.
With interface endpoints?
✅ Fully private operation.
Final Answer
You don't use interface endpoints for permission.
You use them for:
- Private networking
- Security isolation
- Compliance
- Removing internet dependency
- Reducing NAT usage
No comments:
Post a Comment