Controlling access from VPC endpoints with bucket policies
Restricting access to a specific VPC endpoint
aws:SourceVpce
is used to specify the endpoint and requires the VPC endpoint ID.Following Example:
Restricts access to a specific bucket,
awsexamplebucket1
, only from the VPC endpoint with the IDvpce-1a2b3c4d
.Denies all access to the bucket if the specified endpoint is not being used.
Restricting access to a specific VPC
aws:SourceVpc
restricts access to a specific VPC and requires the VPC ID.Useful if you have multiple VPC endpoints configured in the same VPC, and you want to manage access to your S3 buckets for all of your endpoints.
Following Example:
Allows VPC
vpc-111bbb22
to accessawsexamplebucket1
and its objects.Denies all access to the bucket if the specified VPC is not being used.
vpc-111bbb22
key does not require an ARN for the VPC resource, only the VPC ID.
Last updated