Can not access S3 via VPC endpoint in Lambda

前端 未结 4 1624
一整个雨季
一整个雨季 2021-01-05 06:48

I have a Lambda function in my VPC, and I want to access S3 bucket.

I have set S3 VPC endpoint correctly I think,

because I created an EC2 instance in the sa

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-05 07:36

    In addition to all said above, it is also possible that VPC Endpoint policy can be prohibitive and not allowing traffic to/from S3 through. Make sure you allow traffic through endpoint by using "Full access" policy.

    Edit: here's related bit of documentation:

    Your policy must contain a Principal element. For gateway endpoints only, you cannot limit the principal to a specific IAM role or user. Specify "*" to grant access to all IAM roles and users. Additionally, for gateway endpoints only, if you specify the principal in the format "AWS":"AWS-account-ID" or "AWS":"arn:aws:iam::AWS-account-ID:root", access is granted to the AWS account root user only, and not all IAM users and roles for the account.

    So for S3 endpoints to work you need to specify '*' as a principal in general case

提交回复
热议问题