Em 15 de setembro de 2026, todos os ambientes do Cloud Composer 1 e da versão 2.0.x do Cloud Composer 2 vão atingir o fim da vida útil planejado e não poderão mais ser usados. Recomendamos planejar a migração para o Cloud Composer 3.
Nesta página, explicamos a diferença entre os tipos de rede de ambientes de IP privado e público no Cloud Composer 3 e fornecemos instruções para mudar o tipo de rede do seu ambiente.
O Cloud Composer 3 usa dois tipos de rede de ambiente:
Rede de IP público:
Os componentes do Airflow no ambiente podem acessar a
Internet. Esse é o tipo de rede padrão.
Os componentes do Airflow em ambientes de IP público estabelecem conexões de saída de endereços IP públicos e portas alocados automaticamente.
Se você quiser que seus ambientes de IP público usem endereços IP e portas predeterminados, conecte uma rede VPC ao ambiente e mude para IP particular.
Nesse caso, o Cloud Composer encaminha todo o tráfego, exceto o tráfego para serviços do Google, por essa rede.
Rede de IP particular:
Os componentes do Airflow no ambiente não têm acesso à Internet.
Os ambientes de IP particular configuram o Acesso privado do Google pelo intervalo
private.googleapis.com, que permite o acesso a
APIs, serviços e domínios do Google compatíveis com esse intervalo.
Para mais informações e a lista de serviços e domínios disponíveis
pelo private.googleapis.com, consulte
Configuração de rede
na documentação da nuvem privada virtual.
Ambientes de IP particular com o VPC Service Controls configuram o Acesso privado do Google pelo intervalo restricted.googleapis.com, que permite o acesso a APIs, serviços e domínios do Google compatíveis com esse intervalo.
Para mais informações e a lista de serviços e domínios disponíveis
pelo restricted.googleapis.com, consulte
Configuração de rede
na documentação da nuvem privada virtual.
Além dos dois tipos de rede, é possível ativar ou desativar o acesso a uma rede VPC personalizada para qualquer tipo de ambiente. Dependendo da configuração da rede VPC, um ambiente de IP privado pode acessar a Internet por ela.
Rede do Cloud Composer 2 em comparação com o Cloud Composer 3
No Cloud Composer 3, os ambientes de IP particular não exigem configuração.
Os seguintes recursos de rede do Cloud Composer 2 não são mais relevantes no Cloud Composer 3:
É possível definir variáveis de ambientehttp_proxy e https_proxy no seu ambiente. Essas variáveis padrão do Linux são usadas por clientes da Web
que são executados em contêineres do cluster do seu ambiente para encaminhar o tráfego pelos
proxies especificados.
Por padrão, a variável NO_PROXY é definida como uma lista de domínios do Google e localhost para que sejam excluídos do proxy: .google.com,.googleapis.com,metadata.google.internal,localhost. Essa
configuração permite criar um ambiente com variáveis de ambiente http_proxy
e https_proxy definidas em casos em que o proxy não está
configurado para processar o tráfego para os serviços do Google.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-26 UTC."],[[["\u003cp\u003eCloud Composer 3 offers two networking types: Public IP, which allows internet access, and Private IP, which restricts internet access but enables connections to Google services through specific ranges.\u003c/p\u003e\n"],["\u003cp\u003ePublic IP environments have default outbound internet access, while Private IP environments access Google services through \u003ccode\u003eprivate.googleapis.com\u003c/code\u003e or \u003ccode\u003erestricted.googleapis.com\u003c/code\u003e ranges and can gain internet access if configured with a VPC network.\u003c/p\u003e\n"],["\u003cp\u003eCloud Composer 3 simplifies Private IP configurations compared to Cloud Composer 2, eliminating the need for manual settings of IP ranges, networks, or Private Service Connect.\u003c/p\u003e\n"],["\u003cp\u003eThe networking type of a Cloud Composer 3 environment can be switched between Public IP and Private IP using the Google Cloud console, \u003ccode\u003egcloud\u003c/code\u003e command-line tool, API requests, or Terraform configurations.\u003c/p\u003e\n"]]],[],null,["# Change environment networking type (Private or Public IP)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/configure-private-ip \"View this page for Cloud Composer 2\") \\| [Cloud Composer 1](/composer/docs/composer-1/configure-private-ip \"View this page for Cloud Composer 1\")\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page explains the difference between Private IP and Public IP environment\nnetworking types in Cloud Composer 3 and provides instructions for switching\nthe networking type of your environment.\n\nIf you want to disable or enable internet access only when installing PyPI packages, see\n[Configure internet access when installing PyPI packages](/composer/docs/composer-3/packages-internet-access).\n\nIf you want to enable access to your VPC network from your environment,\nsee [Connect an environment to a VPC network](/composer/docs/composer-3/connect-vpc-network).\n\nAbout environment networking types\n----------------------------------\n\nCloud Composer 3 uses two environment networking types:\n\n- *Public IP networking*:\n\n - Airflow components of the environment can access the\n internet. This is the default networking type.\n\n - Airflow components in Public IP environments establish outbound\n connections from automatically allocated public IP addresses and ports.\n If you want your Public IP environments to use predetermined IP\n addresses and ports, you can do so through\n [connecting a VPC network](/composer/docs/composer-3/connect-vpc-network) to your environment\n and [switching it to Private IP](#change-networking-type).\n In this case, Cloud Composer routes all traffic except\n traffic to Google services through this network.\n\n- *Private IP networking*:\n\n - Airflow components of the environment don't have access to\n the internet.\n\n - Private IP environments configure Private Google Access through the\n `private.googleapis.com` range, which enables access to\n Google APIs, services, and domains supported by this range.\n\n For more information and the list of services and domains available\n through `private.googleapis.com`, see\n [Network configuration](/vpc/docs/configure-private-google-access-hybrid#config-choose-domain)\n in the Virtual Private Cloud documentation.\n - [Private IP environments with VPC Service Controls](/composer/docs/composer-3/configure-vpc-sc) configure\n Private Google Access through the `restricted.googleapis.com`\n range, which enables access to Google APIs, services, and domains supported by this range.\n\n For more information and the list of services and domains available\n through `restricted.googleapis.com`, see\n [Network configuration](/vpc/docs/configure-private-google-access-hybrid#config-choose-domain)\n in the Virtual Private Cloud documentation.\n\nIn addition to two networking types, you can\n[enable or disable access to a custom VPC network](/composer/docs/composer-3/connect-vpc-network) for\nany type of environment. Depending on how you configure your VPC network, a\nPrivate IP environment can gain access the internet through you VPC network.\n\n### Cloud Composer 2 networking compared to Cloud Composer 3\n\nIn Cloud Composer 3, Private IP environments require no configuration.\n\nThe following Cloud Composer 2 networking features are no longer relevant in\nCloud Composer 3:\n\n- [Configuring Private IP networking](/composer/docs/composer-2/configure-private-ip). You don't\n need to specify IP ranges, networks, or configure connectivity and firewall\n rules.\n\n- [Configuring Private Service Connect](/composer/docs/composer-2/configure-private-service-connect).\n You don't need to set ranges for Private Service Connect\n in Cloud Composer 3.\n\n | **Note:** [Custom VPC network attachments](/composer/docs/composer-3/connect-vpc-network) in Cloud Composer 3 are based on Private Service Connect. This implementation is **not related** to how Private Service Connect is used in Cloud Composer 2 (for connectivity between the environment's cluster and the resources located in the tenant project). In Cloud Composer 3, network attachments are used differently, you don't need to reflect your Cloud Composer 2 networking setup in them.\n- [Using privately used public IP ranges](/composer/docs/composer-2/configure-privately-used-public-ip). This feature provided an\n option to extend the available IP ranges, which are not required in\n Cloud Composer 3.\n\n- [Using the IP Masquerade agent](/composer/docs/composer-2/enable-ip-masquerade-agent). You don't need to configure\n cluster connectivity in Cloud Composer 3.\n\n- [Configuring authorized networks](/composer/docs/composer-2/configure-authorized-networks). It is not\n possible to access the environment's cluster in Cloud Composer 3.\n\nChange environment networking type\n----------------------------------\n\n### Console\n\n1. In the Google Cloud console, go to the **Environments** page.\n\n [Go to Environments](https://console.cloud.google.com/composer/environments)\n2. In the list of environments, click the name of your environment.\n The **Environment details** page opens.\n\n3. Go to the **Environment configuration** tab.\n\n4. In the **Networking configuration** section, find the\n **Networking type** item and click **Edit**.\n\n5. In the **Networking type** dialog, select:\n\n - **Public IP environment (default)** for Public IP networking.\n - **Private IP environment** for Private IP networking.\n6. Click **Save**.\n\n### gcloud\n\nThe Following Google Cloud CLI arguments change the environment's\nnetworking type:\n\n- `--enable-private-environment`: changes to Private IP networking.\n- `--disable-private-environment`: changes to Public IP networking (default).\n\nChange to Private IP networking: \n\n gcloud beta composer environments update \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --enable-private-environment\n\nChange to Public IP networking: \n\n gcloud beta composer environments update \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --disable-private-environment\n\nReplace the following:\n\n- `ENVIRONMENT_NAME`: the name of the environment.\n- `LOCATION`: the region where the environment is located.\n\nExample (Private IP): \n\n gcloud beta composer environments update example-environment \\\n --location us-central1 \\\n --enable-private-environment\n\nExample (Public IP): \n\n gcloud beta composer environments update example-environment \\\n --location us-central1 \\\n --disable-private-environment\n\n### API\n\n1. Create an [`environments.patch`](/composer/docs/reference/rest/v1beta1/projects.locations.environments/patch) API request.\n\n2. In this request:\n\n 1. In the `updateMask` parameter, specify\n the `config.private_environment_config.enable_private_environment`\n mask.\n\n 2. In the request body, in the `enablePrivateEnvironment` field:\n\n - Specify `true` to change to Private IP networking.\n - Specify `false` to change to Public IP networking (default).\n\nExample (Private IP): \n\n // PATCH https://composer.googleapis.com/v1beta1/projects/example-project/\n // locations/us-central1/environments/example-environment?updateMask=\n // config.private_environment_config.enable_private_environment\n\n \"config\": {\n \"privateEnvironmentConfig\": {\n \"enablePrivateEnvironment\": true\n }\n }\n\n### Terraform\n\nThe `enable_private_environment` field in the `config` block specifies the\nenvironment's networking type:\n\n- `true`: Private IP networking.\n- `false` or omitted: Public IP networking (default).\n\n resource \"google_composer_environment\" \"example\" {\n provider = google-beta\n name = \"\u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e\"\n region = \"\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e\"\n\n config {\n\n enable_private_environment = \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-err\"\u003ePRIVATE_IP_STATUS\u003c/span\u003e\u003c/var\u003e\n\n }\n }\n\nReplace the following:\n\n- `ENVIRONMENT_NAME`: the name of your environment.\n- `LOCATION`: the region where the environment is located.\n- `PRIVATE_IP_STATUS`: `true` for Private IP, `false` for Public IP\n\nExample (Private IP): \n\n resource \"google_composer_environment\" \"example\" {\n provider = google-beta\n name = \"example-environment\"\n region = \"us-central1\"\n\n config {\n\n enable_private_environment = true\n\n ... other configuration parameters\n }\n }\n\nConfigure proxy server variables\n--------------------------------\n\n| **Important:** Routing with proxy variables is done on a best-effort basis. **There's no guarantee that every request goes through the proxy** . Instead, we recommend to route traffic by [attaching a VPC network](/composer/docs/composer-3/connect-vpc-network) to your environment and configuring traffic routing rules in this network.\n\nYou can set `http_proxy` and `https_proxy` [environment variables](/composer/docs/composer-3/set-environment-variables)\nin your environment. These standard Linux variables are used by web clients\nthat run in containers of your environment's cluster to route traffic through\nthe specified proxies.\n\nThe `NO_PROXY` variable by default is set to a list of Google domains and\n`localhost` so that they are excluded from proxying:\n`.google.com,.googleapis.com,metadata.google.internal,localhost`. This\nconfiguration makes it possible to create an environment with set `http_proxy`\nand `https_proxy` environment variables in cases when the proxy isn't\nconfigured to handle traffic to Google services.\n\nWhat's next\n-----------\n\n- [Configure VPC Service Controls](/composer/docs/composer-3/configure-vpc-sc)"]]