To Nha Notes | Feb. 4, 2025, 4:10 p.m.
A VPC Endpoint is a secure connection between your VPC and S3, ensuring that traffic to and from your S3 bucket stays within the Amazon network and never traverses the public internet. This provides better performance, security, and compliance for your infrastructure.
To create a gateway endpoint using the console:
Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.
In the navigation pane, choose Endpoints.
Choose Create endpoint.
For Service category, choose AWS services.
For Services, add the filter Type = Gateway and select com.amazonaws.region.s3.
For VPC, select the VPC in which to create the endpoint.
For Route tables, select the route tables to be used by the endpoint. We automatically add a route that points traffic destined for the service to the endpoint network interface.
For Policy, select Full access to allow all operations by all principals on all resources over the VPC endpoint. Otherwise, select Custom to attach a VPC endpoint policy that controls the permissions that principals have to perform actions on resources over the VPC endpoint.
(Optional) To add a tag, choose Add new tag and enter the tag key and the tag value.
Choose Create endpoint.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::your-bucket-name/*",
"Condition": {
"StringEquals": {
"aws:SourceVpc": "vpc-xxxxxxxx"
}
}
}
]
}
https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies-vpc-endpoint.html
https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-s3.html#create-gateway-endpoint-s3