Tambahkan definisi lingkungan baru ke array envs dalam file penggantian Anda.
Beri lingkungan baru nama yang sama dengan yang Anda buat di UI.
Misalnya, konfigurasi berikut menentukan dua lingkungan: test
dan prod:
Jika Anda memiliki beberapa lingkungan, setiap lingkungan dapat memiliki alias hostnya sendiri, atau beberapa lingkungan dapat berbagi alias host yang sama. Untuk mengetahui detailnya, lihat
Tentang host virtual dan lingkungan serta
Lingkungan dapat menggunakan alias host yang sama. Jika beberapa lingkungan memiliki alias host yang sama, Anda harus menggunakan teknik yang disebut rute jalur dasar untuk merutekan permintaan proxy ke lingkungan yang benar.
Kunci dan sertifikat TLS
Saat membuat lingkungan baru, Anda harus memberikan kunci dan sertifikat TLS ke konfigurasi
lingkungan. Kunci/sertifikat digunakan untuk menyediakan komunikasi yang aman dengan gateway masuk.
Anda dapat memilih cara membuat pasangan kunci/sertifikat TLS yang sesuai untuk konfigurasi
campuran. Topik berikut hanya diberikan sebagai contoh, yang terutama ditujukan
untuk mencoba atau menguji penginstalan campuran baru jika tidak memungkinkan untuk mendapatkan
kredensial TLS dengan cara lain:
Lihat Mendapatkan kredensial TLS untuk mengetahui kumpulan contoh
langkah-langkah membuat pasangan kunci/sertifikat TLS yang diotorisasi.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-03 UTC."],[],[],null,["# Create environments\n\n| You are currently viewing version 1.1 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\n\nThis topic explains how to create new environments. For an introduction, see\n[About environments and environment groups](/apigee/docs/api-platform/fundamentals/environments-overview).\n\nHow to add an environment\n-------------------------\n\n\nThe steps for adding an environment are described in adding and configuring an environment are\nexplained in [Step 5: Add an environment](/apigee/docs/hybrid/v1.1/precog-add-environment) and [Specify configuration overrides](/apigee/docs/hybrid/v1.1/install-copy-overrides#specify-configuration-overrides).\n\nHow to add multiple environments\n--------------------------------\n\n1. Create a new environment in the [Apigee UI](https://apigee.google.com) or with the [Create environments API](/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments/create). For the basic steps, see [Step 5: Add an environment](/apigee/docs/hybrid/v1.1/precog-add-environment).\n2. Add a new environment definition to the `envs` array in your overrides file.\n Give the new environment the same name as the one you created in the UI.\n For example, the following configuration defines two environments: **test**\n and **prod**:\n\n ```\n namespace: my-namespace\n org: my-organization\n ...\n envs:\n - name: test\n sslCertPath: \"your_certpath/ingress-cert.crt\"\n sslKeyPath: \"your_keypath/ingress-key.key\"\n hostAlias: \"apitest.example.com\"\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n - name: prod\n sslCertPath: \"your_certpath/ingress-cert.crt\"\n sslKeyPath: \"your_keypath/ingress-key.key\"\n hostAlias: \"apiprod.example.com\"\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n ...\n ```\n\n\nFor a complete list of environment configuration elements, see [envs]() in the\n[Configuration\nproperty reference](/apigee/docs/hybrid/v1.1/config-prop-ref#envs).\n\nHost aliases with multiple environments\n---------------------------------------\n\n\nIf you have multiple enviroments, each one can have its own host alias, or multiple enviromments\ncan share the same host alias. For details, see [About virtual hosts and environments](/apigee/docs/hybrid/v1.1/environments-about#about-virtual-hosts-and-environments) and [Environments can share the same host alias](/apigee/docs/hybrid/v1.1/environments-about#environments-can-share-the-same-host-alias). If multiple environments share the same\nhost alias, you must use the technique called [base path routing](/apigee/docs/hybrid/v1.1/base-path-routing)\nto route proxy requests to the correct environment.\n\nTLS keys and certificates\n-------------------------\n\nWhen you create a new environment, you must provide a TLS key and certificate to the environment\nconfiguration. The key/cert are used to provide secure communication with the ingress gateway.\n\n\nIt is up to you how you generate proper TLS certificate/key pairs for your hybrid\nconfiguration. The following topics are provided as samples only, intended primarily\nfor trying out or testing a new hybrid installation if it isn't feasible to obtain\nTLS credentials in another way:\n\n- See [Obtain TLS credentials](/apigee/docs/hybrid/v1.1/lets-encrypt) for a set of sample steps for creating an authorized TLS certificate/key pair.\n- You can use a self-signed certificate/key pair(s) for testing purposes only. See [Generate self-signed TLS credentials](/apigee/docs/hybrid/v1.1/environment-self-signed-tls)."]]