docs: Example policy for VPC endpoint needs Allow statement; S3 endpoint should be type 'Gateway' #1197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I've been troubleshooting a problem with an EKS cluster running in a VPC created by terraform-aws-vpc. Most of my setup was cribbed from your complete example. Attempts to pull images from ECR in the same region were consistently denied while those in other regions worked fine.
AWS Support managed to identify the problem. It was that ECR endpoints created using the
generic_endpoint_policy
from the example lack anyAllow
statement to permit access. Allow statements aren't implicit in IAM policies so this defaulted to denying all requests.Calls to ECR in the same region therefore failed. Ones to ECR in other regions went out via my NAT gateway instead of using the local endpoint, so confusingly they still worked fine.
The PR fixes the issue by adding the missing
Allow
statement. AWS support have also advised me S3 endpoints should typically be set as typeGateway
, so I've modified the example to do this too.Motivation and Context
It solves the problem of ECR images failing to pull via VPC endpoints created following the example bundled with terraform-aws-vpc.
Breaking Changes
No
How Has This Been Tested?
Please describe how you tested your changes
pre-commit run -a
on my pull request