Install the AWS CLI into your DevBox.
Go to AWS Console > IAM > Users > Create user.
Add the following permissions to the user: AmazonS3FullAccess.
After you obtained the credentials, log into the AWS CLI by running:
Update your S3 access policy to allow access to the new user.
Verify you can query the S3 bucket:
Follow the Connecting to AWS guide.
Go to VPC > Endpoints > Create Endpoint.
Enter a name then select "AWS Services" as your Service category.
In the "Services" search bar type "S3" and select the suggested service (Interface).
Under VPC, select your EC2 "relay" VPC.
Select the desired subnets.
Select the desired security groups. Make sure that you allow inbound/outbound access to/from your EC2 instance.
Specify custom VPC endpoint policies, if required.
Click on "Create endpoint" to proceed.
Set your S3 Bucket policy as follows:
Running the following in your DevBox terminal:
Will result in:
Running the same command with a custom endpoint should result in no errors however: