Tambahkan definisi lingkungan baru ke properti envs[] dalam file penggantian Anda.
Perhatikan bahwa properti ini adalah array; oleh karena itu, Anda dapat menambahkan lebih dari satu definisi lingkungan ke dalamnya.
Beri lingkungan baru nama yang sama dengan yang Anda buat di UI.
Misalnya, konfigurasi berikut menentukan dua lingkungan: test
dan prod:
Untuk informasi selengkapnya tentang konfigurasi host virtual, termasuk cara mengonfigurasi beberapa aturan perutean jalur dasar, lihat Mengonfigurasi host virtual.
Untuk mengetahui daftar lengkap elemen konfigurasi lingkungan, lihat envs di
Referensi properti
konfigurasi.
[[["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-08-18 UTC."],[[["\u003cp\u003eThis document outlines the two-step process for creating new environments in Apigee hybrid, involving environment creation in the management plane and configuration addition in the cluster's overrides file.\u003c/p\u003e\n"],["\u003cp\u003eNew environments can be created either via the Apigee UI or through the Create environments API, after which the environment definition must be added to the \u003ccode\u003eenvs[]\u003c/code\u003e property in the overrides file.\u003c/p\u003e\n"],["\u003cp\u003eThe overrides file's \u003ccode\u003evirtualhosts\u003c/code\u003e property should be updated to map its routing rules to the newly created environment(s).\u003c/p\u003e\n"],["\u003cp\u003eChanges made to the \u003ccode\u003eenvs[]\u003c/code\u003e and \u003ccode\u003evirtualhosts[]\u003c/code\u003e properties require a specific \u003ccode\u003eapigeectl\u003c/code\u003e command to apply them to the cluster, and another command if only \u003ccode\u003evirtualhosts\u003c/code\u003e is updated.\u003c/p\u003e\n"],["\u003cp\u003eThis documentation pertains to Apigee hybrid version 1.2, which is end-of-life, and users are advised to upgrade to a newer version.\u003c/p\u003e\n"]]],[],null,["# Create environments\n\n| You are currently viewing version 1.2 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\nAbout environment creation\n--------------------------\n\n\nEnvironment creation is a two-step process:\n\n- Create an enviroment in the management plane using either the UI or an Apigee API.\n- Add configuration for that environment to your overrides file and apply it to the cluster.\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.2/precog-add-environment) and [Specify configuration overrides](/apigee/docs/hybrid/v1.2/install-copy-overrides#specify-configuration-overrides).\n\nHow to create an environment\n----------------------------\n\n1. Create one or more new environments 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.2/precog-add-environment).\n2. Add a new environment definition to the `envs[]` property in your overrides file.\n Note that the property is an array; therefore, you can add more than one environment definition\n to it.\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 ```actionscript-3\n namespace: my-namespace\n org: my-organization\n ...\n envs:\n - name: test\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n\n - name: prod\n serviceAccountPaths:\n synchronizer: \"your_keypath/synchronizer-manager-service-account.json\n udca: \"your_keypath/analytic-agent-service-account.json\n ...\n ```\n3. Add a `virtualhosts` property that maps its `routingRules` to the environment(s). \n\n ```\n virtualhosts:\n - name: default\n hostAliases: [\"api.example.com\"]\n sslCertPath: ./certs/fullchain.pem\n sslKeyPath: ./certs/privkey.pem\n routingRules:\n - env: test\n ```\n4. Apply any changes to the cluster. If you changed both the `envs[]` and `virtualhosts[]` properties, apply changes with the following command: \n\n ```\n apigeectl apply -f overrides-file.yaml -c synchronizer,udca,runtime\n ```\n\n\n If you only change the `virtualhosts` property, apply those config changes\n with the `--settings` flag: \n\n ```\n apigeectl apply -f overrides-file.yaml --settings virtualhosts\n ```\n\n\nFor more information about virtual host configuration, including how to configure\nmultiple basepath routing rules, see [Configure virtual hosts](/apigee/docs/hybrid/v1.2/base-path-routing).\nFor a complete list of environment configuration elements, see [envs](/apigee/docs/hybrid/v1.2/config-prop-ref#envs) in the\n[Configuration\nproperty reference](/apigee/docs/hybrid/v1.2/config-prop-ref#envs)."]]