Use AWS CodeBuild with a proxy server
You can use AWS CodeBuild with a proxy server to regulate HTTP and HTTPS traffic to and from the internet. To run CodeBuild with a proxy server, you install a proxy server in a public subnet and CodeBuild in a private subnet in a VPC.
There are two primary use cases for running CodeBuild in a proxy server:
-
It eliminates the use of a NAT gateway or NAT instance in your VPC.
-
It lets you specify the URLs that instances in the proxy server can access and the URLs to which the proxy server denies access.
You can use CodeBuild with two types of proxy servers. For both, the proxy server runs in a public subnet and CodeBuild runs in a private subnet.
-
Explicit proxy: If you use an explicit proxy server, you must configure
NO_PROXY
,HTTP_PROXY
, andHTTPS_PROXY
environment variables in CodeBuild at the project level. For more information, see Change build project settings in AWS CodeBuild and Create a build project in AWS CodeBuild. -
Transparent proxy: If you use a transparent proxy server, no special configuration is required.