CodeBuild 找不到目标 Internet 网关的 0.0.0.0/0 目标 [英] CodeBuild cannot find the 0.0.0.0/0 destination for the target internet gateway

查看:24
本文介绍了CodeBuild 找不到目标 Internet 网关的 0.0.0.0/0 目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为此苦苦挣扎了几个小时.因此,我创建了我的 VPC 以及 4 个不同的子网.前三个连接到常规 Internet 网关.最后一个连接到 NAT 网关(以 0.0.0.0/0 作为目标).我的 CodeBuild 项目设置为使用此 VPC 和最后一个子网.

I've been struggling with this for hours. So, I created my VPC, along with 4 different subnets. The first three are attached to a regular Internet Gateway. The last one is attached to a NAT Gateway (with 0.0.0.0/0 as Destination). My CodeBuild project is set to use this VPC and the last subnet.

当我在 CodeBuild 项目环境中单击验证 VPC 设置"时,收到此警告:

When I click "Validate VPC Settings" in the CodeBuild Project Environment, I get this warning:

ID 为 * 的 VPC 可能没有互联网连接.CodeBuild 找不到子网 ID 为 * 的目标互联网网关的 0.0.0.0/0 目的地."

如果我尝试运行 CodeBuild 项目,它将超时,因为它无法访问 Internet 并且无法从 CodeCommit 下载源...

If I try to run the CodeBuild project, it will timeout because it has no internet access and cannot download sources from CodeCommit...

我在这里错过了什么?我的子网的路由表附加到 NAT 网关,目标是 0.0.0.0/0,所以上面的错误消息对我没有任何意义.

What am I missing here? The Routing Table for my subnet is attached to the NAT Gateway and the Destination is 0.0.0.0/0, so the error message above doesn't make any sense to me.

谢谢!

推荐答案

所以,万一其他人遇到同样的问题,原因是我错误地将 NAT 网关放置在私有子网而不是公共子网上.

So, in case anyone else has the same issue, the reason was that I mistakenly placed my NAT Gateway on a private subnet instead of a public one.

这篇关于CodeBuild 找不到目标 Internet 网关的 0.0.0.0/0 目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆