이 단계에서는 Apigee Hybrid가 작동하는 데 필요한 Google Cloud 서비스 계정과 TLS 사용자 인증 정보를 만드는 방법을 설명합니다.
서비스 계정 만들기
Apigee Hybrid는 Google Cloud 서비스 계정을 사용하여 승인된 API 호출을 만들어 하이브리드 구성요소가 통신할 수 있도록 합니다.
이 단계에서는 Apigee Hybrid 명령줄 도구를 사용하여 서비스 계정 집합을 만들고 서비스 계정 비공개 키 파일을 다운로드합니다.
Apigee는 서비스 계정을 만들고, 서비스 계정에 역할을 할당하고, 단일 명령어로 서비스 계정의 키 파일을 만들고 다운로드하는 create-service-account 도구를 제공합니다. 관련 Google Cloud 개념에 대한 자세한 내용은서비스 계정 만들기 및 관리와 서비스 계정 키 만들기 및 관리를 참조하세요.
프로젝트 디렉터리 구조 설정에서 구성한 base_directory/hybrid-files 디렉터리에 있는지 확인합니다.
hybrid-files 디렉터리 내에서 다음 명령어를 실행합니다. 이 명령어는 비프로덕션 환경에 사용할 apigee-non-prod라는 단일 서비스 계정을 만들고 다운로드한 키 파일을 ./service-accounts 디렉터리에 둡니다.
[INFO]: gcloud configured project ID is project_id.
Enter: y to proceed with creating service account in project: project_id
Enter: n to abort.
도구로 할당된 동일한 이름의 SA를 처음 만든 경우 도구에서 이미 생성되었으므로, 사용자가 더 이상 추가 작업을 수행할 필요가 없습니다.
하지만 다음 메시지 및 프롬프트가 표시되면 y를 입력하여 새 키를 생성합니다.
[INFO]: Service account apigee-non-prod@project_id.iam.gserviceaccount.com already exists.
...
[INFO]: The service account might have keys associated with it. It is recommended to use existing keys.
Press: y to generate new keys.(this does not de-activate existing keys)
Press: n to skip generating new keys.
다음 명령어를 사용하여 서비스 계정 키가 생성되었는지 확인합니다. 이러한 비공개 키를 안전하게 보관할 책임은 사용자에게 있습니다. 키 파일 이름에는 Google Cloud 프로젝트 이름이 프리픽스로 추가됩니다.
ls ./service-accounts
다음과 같은 결과가 표시됩니다.
project_id-apigee-non-prod.json
이제 서비스 계정을 만들고 Apigee Hybrid 구성요소에 필요한 역할을 할당했습니다. 그런 후 TLS 인증서가 하이브리드 인그레스 게이트웨이에 필요합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eThis documentation version (1.5) is end-of-life, and upgrading to a newer version is recommended for continued support and access to the latest features.\u003c/p\u003e\n"],["\u003cp\u003eApigee hybrid utilizes Google Cloud service accounts to facilitate communication between hybrid components through authorized API calls, and this section provides guidance on creating them.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecreate-service-account\u003c/code\u003e tool provided by Apigee simplifies the process of creating service accounts, assigning roles, and downloading the associated key files, with options for non-production or production environments.\u003c/p\u003e\n"],["\u003cp\u003eFor a non-production setup, a single service account named "apigee-non-prod" can be used, while separate service accounts for each component are recommended in a production setting.\u003c/p\u003e\n"],["\u003cp\u003eAfter creating the service accounts, it is important to securely store the downloaded private key files, which are essential for hybrid component communication and also to note that the next step involves creating the required TLS certificates for the hybrid ingress gateway.\u003c/p\u003e\n"]]],[],null,["# Step 5: Create service accounts and credentials\n\n| You are currently viewing version 1.5 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\nThis step explains how to create the Google Cloud service accounts and TLS credentials\nthat are required for Apigee hybrid to operate.\n\nCreate the service accounts\n---------------------------\n\n\nApigee hybrid uses Google Cloud [service accounts](/iam/docs/service-accounts) to\nallow hybrid components to communicate by making authorized API calls.\n\n\nIn this step, you use an Apigee hybrid command-line tool to create a set of service accounts\nand download the service account private key files.\n| **Note:** In a production hybrid environment Apigee recommends using a separate service account for each component. For purposes of this tutorial, you can create a single service account named \"apigee-non-prod\" that you can use for all components.\n|\n|\n| To learn more about service accounts and read the full list of service accounts recommended for\n| production environments, see the following:\n|\n| - [About service accounts](/apigee/docs/hybrid/v1.5/sa-about)\n| - [Service accounts and roles used by hybrid components](/apigee/docs/hybrid/v1.5/sa-about#recommended-sas)\n\n\nApigee provides a tool, `create-service-account`, that creates the service accounts,\nassigns the roles to the service accounts, and creates and downloads the key files for the service\naccount in a single command. To learn about the related Google Cloud concepts, see\n[Creating\nand managing service accounts](https://cloud.google.com/iam/docs/creating-managing-service-accounts) and\n[Creating\nand managing service account keys](https://cloud.google.com/iam/docs/creating-managing-service-account-keys).\n\n1. Be sure that you are in the \u003cvar translate=\"no\"\u003ebase_directory\u003c/var\u003e`/hybrid-files` directory you configured in [Set up the project directory structure](#setup-directory).\n2. Execute the following command from inside the `hybrid-files` directory. This command creates a single service account named `apigee-non-prod` for use in a non-production environments and places the downloaded key file in the `./service-accounts` directory. \n\n ```\n ./tools/create-service-account --env non-prod --dir ./service-accounts --project-id PROJECT_ID\n ```\n\n\n Where \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the Project ID of the Google Cloud project in which you are\n creating the service accounts. See also [create-service-account syntax](/apigee/docs/hybrid/v1.6/create-service-account#syntax).\n | **Note:** If you would prefer to create all the individual service accounts for a production environment, use the following command: \n |\n | ```\n | ./tools/create-service-account --env prod --dir ./service-accounts\n | ```\n\n\n When you see the following prompt, enter \u003ckbd\u003ey\u003c/kbd\u003e: \n\n ```\n [INFO]: gcloud configured project ID is project_id.\n Enter: y to proceed with creating service account in project: project_id\n Enter: n to abort.\n ```\n\n\n If this is the first time an SA with the same name assigned by the tool was created, then\n the tool just creates it, and you do not have to do anything further.\n\n\n If, however, you see the following message and prompt, enter \u003ckbd\u003ey\u003c/kbd\u003e to generate\n new keys: \n\n ```\n [INFO]: Service account apigee-non-prod@project_id.iam.gserviceaccount.com already exists.\n ...\n [INFO]: The service account might have keys associated with it. It is recommended to use existing keys.\n Press: y to generate new keys.(this does not de-activate existing keys)\n Press: n to skip generating new keys.\n ```\n | **Note:** The Cloud Pub/Sub API must be enabled in the Google Cloud project that owns the service account for Synchronizer. See [Enable APIs](/apigee/docs/hybrid/v1.5/precog-enableapi).\n3. Verify that the service account key was created using the following command. You are responsible for storing these private keys securely. The key filenames are prefixed with the name of your Google Cloud project. \n\n ```\n ls ./service-accounts\n ```\n\n\n The result should look something like the following: \n\n ```\n project_id-apigee-non-prod.json\n ```\n\n| **Tip:** Apigee hybrid includes a validator that checks your service accounts' key files and permissions when [apigeectl](/apigee/docs/hybrid/v1.5/cli-reference) applies the Apigee hybrid runtime components to your cluster. This validation is enabled by default. For more information, see [Service account\n| validation](/apigee/docs/hybrid/v1.5/sa-validation).\n\n\nYou now have created service accounts and assigned the roles needed by the Apigee hybrid\ncomponents. Next, the TLS certificates required by the hybrid ingress gateway..\n[1](/apigee/docs/hybrid/v1.5/install-create-cluster) [2](/apigee/docs/hybrid/v1.5/install-cert-manager) [3](/apigee/docs/hybrid/v1.5/install-asm) [4](/apigee/docs/hybrid/v1.5/install-apigeectl) [5](/apigee/docs/hybrid/v1.5/install-service-accounts) [(NEXT) Step 6: Create TLS certificates](/apigee/docs/hybrid/v1.5/install-create-tls-certificates) [7](/apigee/docs/hybrid/v1.5/install-configure-cluster) [8](/apigee/docs/hybrid/v1.5/install-enable-synchronizer-access) [9](/apigee/docs/hybrid/v1.5/install-hybrid-runtime)\n\n\u003cbr /\u003e"]]