Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
52 views

Amazon Web Services - AWS CodeBuild - Build Does Not Have Internet Connectivity. Please Check Subnet Network Configuration - Stack Overflow

The document discusses an issue where an AWS CodeBuild build fails with the error message "Build does not have internet connectivity. Please check subnet network configuration." The asker checked their VPC configuration and security groups, and confirmed an EC2 instance in the same subnet could connect to external services, but the CodeBuild build could not. Respondents explained that for a CodeBuild build to have internet access, it must be run in a private subnet with a NAT gateway connected to the internet gateway, as CodeBuild builds do not receive public IPs like EC2 instances in public subnets. The asker had overlooked using a private subnet and realized this was required for the CodeBuild build to access the internet via NAT gateway.

Uploaded by

futuregm2400
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Amazon Web Services - AWS CodeBuild - Build Does Not Have Internet Connectivity. Please Check Subnet Network Configuration - Stack Overflow

The document discusses an issue where an AWS CodeBuild build fails with the error message "Build does not have internet connectivity. Please check subnet network configuration." The asker checked their VPC configuration and security groups, and confirmed an EC2 instance in the same subnet could connect to external services, but the CodeBuild build could not. Respondents explained that for a CodeBuild build to have internet access, it must be run in a private subnet with a NAT gateway connected to the internet gateway, as CodeBuild builds do not receive public IPs like EC2 instances in public subnets. The asker had overlooked using a private subnet and realized this was required for the CodeBuild build to access the internet via NAT gateway.

Uploaded by

futuregm2400
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

4/10/22, 1:02 AM amazon web services - AWS CodeBuild – 

Build does not have internet connectivity. Please check subnet network configuration - …

AWS CodeBuild – Build does not have internet connectivity. Please


check subnet network configuration
Asked
4 years, 2 months ago Modified
4 years, 2 months ago Viewed
7k times

I am experimenting with CodeBuild but have reached a dead-end. My build always fails with the
error message:
21
Build does not have internet connectivity. Please check subnet network configuration.

4 I checked the VPC configuration (subnet, security groups), and they seem okay. To test internet
connectivity, I launched an EC2 instance in the same subnet, and it is able to communicate with
external services (I tried a ping and some HTTP GETs).

How do I resolve this 'internet connectivity' issue?

amazon-web-services aws-codebuild

Share Improve this question Follow asked Jan 30, 2018 at 13:21
John Keyes
5,309 1 27 45

Sorted by:
2 Answers
Highest score (default)

When you are assigning the CodeBuild project to a subnet, it must be a private subnet with a
NAT gateway that is connected to the internet gateway.
23
I had this same issue, but I was quite early in the project so I could tear it down and start again.

From the VPC Dashboard I used the 'Start VPC Wizard' button where I could select a template
named 'VPC with Public and Private Subnets'. I still had to create the security groups and assign
an elastic IP.

Once the new VPC was generated and configured I reconfigured my CodeBuild project to use the
private subnet in the new VPC and the provisioning step succeeded.

I hope this helps.

Join Stack
ShareOverflow to find
Improve this the Follow
answer best answer to your technical question, help others
answered Feb 4, 2018 at 13:05
Sign up
answer theirs. Mark Allen

https://stackoverflow.com/questions/48522481/aws-codebuild-build-does-not-have-internet-connectivity-please-check-subnet-n 1/2
4/10/22, 1:02 AM amazon web services - AWS CodeBuild – Build does not have internet connectivity. Please check subnet network configuration - …

401 3 6

1 Thanks Mark, I can't believe I overlooked this. When I read the first line of your answer I was in "slap your
forehead John" mode.
–  John Keyes
Feb 6, 2018 at 13:20

1 I just lost a couple of hours for this. Future readers, do not ignore the bolded word private. It is important
and makes a difference.
– Dzhuneyt
Aug 28, 2019 at 18:45

CodeBuild builds require a NAT Gateway to reach the internet, because they do not get assigned
a public IP address like an EC2 instance does in a public subnet. You can think of it like CodeBuild
14 builds are always in a private subnet in your VPC:
https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Scenario2.html

See this documentation for more troubleshooting steps, including a CloudFormation template for
setting up a VPC with a NAT Gateway:
https://docs.aws.amazon.com/codebuild/latest/userguide/vpc-support.html#troubleshooting

Share Improve this answer Follow answered Jan 30, 2018 at 19:23
Clare Liguori
1,444 10 10

Thanks Clare. I've setup the NAT, and it has an Elastic IP and is on the same public subnet I had the EC2
instance on. I thought that was all the configuration needed. It doesn't seem to be the case. I've gone
through the steps of the troubleshooting section already, and nothing obvious has seemed off. I need to
further educate myself it seems.
–  John Keyes
Jan 30, 2018 at 22:46

Clare, I was missing the private part of the answer in when reading your answer. Thanks for your help.
–  John Keyes
Feb 6, 2018 at 13:21

Join Stack Overflow to find the best answer to your technical question, help others
Sign up
answer theirs.

https://stackoverflow.com/questions/48522481/aws-codebuild-build-does-not-have-internet-connectivity-please-check-subnet-n 2/2

You might also like