Can not access S3 via VPC endpoint in Lambda

前端 未结 4 1616
一整个雨季
一整个雨季 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:35

    Thanks everyone! I found the reason.

    My Lambda have two subnets, private_sn_1 and private_sn_2,

    private_sn_1 have correctly set the vpc endpoint route table,

    but the private_sn_2 set a wrong route table,

    and my ec2 created in private_sn_1 so it can access the vpc endpoint.

    In normal, Lambda will run randomly in private_sn_1 or private_sn_2,

    but in my case it always run in private_sn_2(I don't know why),

    so when I fixed the private_sn_2 route table,

    everything is right.

提交回复
热议问题