IAP를 사용 설정하여 비공개 온프렘, Compute Engine, GKE 또는 기타 엔드포인트 호출
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
엔드포인트에 대해 IAP(Identity-Aware Proxy)를 사용 설정하여 Workflows에서 비공개 온프레미스, Compute Engine, Google Kubernetes Engine(GKE), 기타 Google Cloud 엔드포인트를 호출할 수 있습니다.
IAP는 액세스 제어 정책을 적용하는 데 사용되며 HTTPS로 액세스되는 애플리케이션의 중앙 승인 레이어를 설정하여 네트워크 수준 방화벽에 의존하지 않고 애플리케이션 수준 액세스 제어 모델을 사용할 수 있도록 합니다. 자세한 내용은 IAP 개요 및 다음 내용을 참조하세요.
또는 Workflows와 서비스 디렉터리의 서비스 레지스트리를 함께 사용하면 워크플로 실행에서 HTTP 호출의 비공개 엔드포인트를 타겟팅할 수 있습니다. 가상 프라이빗 클라우드(VPC) 네트워크 내에서 비공개 엔드포인트를 만들면 엔드포인트가 VPC 서비스 제어 규정을 준수할 수 있습니다. 자세한 내용은 VPC 서비스 제어 규정을 준수하는 비공개 엔드포인트 호출을 참조하세요.
HTTP 요청 수행
Workflows에서 비공개 엔드포인트를 호출할 때 HTTP 요청이 수행됩니다. 가장 일반적인 HTTP 요청 메서드에는 호출 단축키(예: http.get 및 http.post)가 있지만, call 필드를 http.request로 설정하고 method 필드를 사용해 요청 유형을 지정하여 모든 유형의 HTTP 요청을 수행할 수 있습니다. 자세한 내용은 HTTP 요청 수행을 참조하세요.
필요한 권한이 있는 서비스 계정 사용
다른 Google Cloud 서비스에 요청을 수행할 때는 요청된 리소스에 액세스하는 데 필요한 권한이 포함된 Identity and Access Management(IAM) 역할이 하나 이상 부여된 서비스 계정에 워크플로를 연결해야 합니다. 기존 워크플로와 연결된 서비스 계정에 대해 알아보려면 워크플로의 연결된 서비스 계정 확인을 참조하세요.
서비스 계정을 설정할 때 액세스 권한을 부여할 리소스와 요청 ID를 연결하고 요청 ID를 리소스의 주 구성원 또는 사용자로 만든 후 적절한 역할을 할당합니다.
역할은 리소스 컨텍스트에서 ID의 권한을 정의합니다. 애플리케이션 또는 리소스가 IAP에 의해 보호되는 경우 올바른 역할을 가진 주 구성원만 프록시를 통해 액세스할 수 있습니다.
예를 들어 인증 후 IAP는 관련 허용 정책을 적용하여 주 구성원이 요청된 리소스에 액세스하도록 허용되었는지 확인합니다. 주 구성원에게 리소스가 있는 Google Cloud 콘솔 프로젝트에 대한 IAP 보안 웹 앱 사용자 역할(roles/iap.httpsResourceAccessor)이 있으면 애플리케이션에 액세스하는 권한을 가집니다.
Workflows 서비스 계정을 주 구성원으로 추가하여 IAP 페이지를 통해 IAP 보호 리소스에 대해 액세스를 구성할 수 있습니다. 자세한 내용은 IAP 보호 리소스에 대한 액세스 관리를 참조하세요.
워크플로에 인증 정보 추가
기본적으로 HTTP 요청은 보안상의 이유로 ID 또는 액세스 토큰을 포함하지 않습니다. 워크플로 정의에 인증 정보를 명시적으로 추가해야 합니다. 비공개 엔드포인트를 요청하려면 OIDC를 사용해서 IAP를 통해 인증합니다.
OIDC를 사용하여 HTTP 요청을 수행하려면 URL을 지정한 후 워크플로 정의의 args 섹션에 auth 섹션을 추가합니다.
[[["이해하기 쉬움","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-04(UTC)"],[],[],null,["# Invoke a private on‑prem, Compute Engine, GKE, or other endpoint by enabling IAP\n\nYou can invoke a private on‑premises, Compute Engine,\nGoogle Kubernetes Engine (GKE), or other Google Cloud endpoint from\nWorkflows by enabling Identity-Aware Proxy (IAP) for the endpoint.\nIAP is used to enforce access control policies, and it lets you\nestablish a central authorization layer for applications accessed by HTTPS, so\nthat you can use an application-level access control model instead of relying on\nnetwork-level firewalls.\n\nFor more information, see the\n[IAP overview](/iap/docs/concepts-overview) and the following\nguides:\n\n- [Enable IAP for App Engine](/iap/docs/authenticate-users-google-accounts)\n- [Enable IAP for Cloud Run](/iap/docs/enabling-cloud-run)\n- [Enable IAP for Compute Engine](/iap/docs/enabling-compute-howto)\n- [Enable IAP for GKE](/iap/docs/enabling-kubernetes-howto)\n- [Enable IAP for on‑premises apps](/iap/docs/enabling-on-prem-howto)\n\nAlternatively, you can target a private endpoint for HTTP calls from your\nworkflow execution by using Service Directory's service registry with\nWorkflows. For more information, see\n[Invoke a private endpoint using Service Directory's service registry](/workflows/docs/invoke-private-endpoint-vpc).\n\nMake an HTTP request\n--------------------\n\nCalling or invoking a private endpoint from Workflows is done\nthrough an HTTP request. The most common HTTP request methods have a call\nshortcut (such as [http.get](/workflows/docs/reference/stdlib/http/get)\nand [http.post](/workflows/docs/reference/stdlib/http/post)), but you can make\nany type of HTTP request by setting the `call` field to `http.request` and\nspecifying the type of request using the `method` field. For\nmore information, see [Make an HTTP request](/workflows/docs/http-requests).\n\nUse a service account with the required permissions\n---------------------------------------------------\n\nWhen making requests to other Google Cloud services, your workflow must\nbe associated with a service account that has been granted one or more\nIdentity and Access Management (IAM) roles containing the required permissions to access\nthe requested resources. To learn what service account is associated with an\nexisting workflow, see\n[Verify a workflow's associated service account](/workflows/docs/authentication#verify-service-account).\n\nWhen setting up a service account, you associate the requesting identity with\nthe resource you want to give it access to---you make the requesting identity a\n*principal*, or user, of the resource---and then assign it the appropriate role.\nThe role defines what permissions the identity has in the context of the\nresource. When an application or resource is protected by IAP,\nit can only be accessed through the proxy by principals who have the correct\nrole.\n\nFor example, after authentication, IAP applies the relevant\nallow policy to check if the principal is authorized to access the requested\nresource. If the principal has the **IAP-secured Web App User** role\n(`roles/iap.httpsResourceAccessor`) on the Google Cloud console project\nwhere the resource exists, they're authorized to access the application.\n\nYou can configure access to your IAP-secured resource through\nthe [IAP page](https://console.cloud.google.com/security/iap) by adding the\nWorkflows service account as a principal. For more information,\nsee [Managing access to IAP-secured resources](/iap/docs/managing-access).\n\nAdd authentication information to your workflow\n-----------------------------------------------\n\n| **Note:** This authentication method is restricted to HTTPS endpoints.\n\nBy default, HTTP requests don't contain identity or access tokens for security\nreasons. You must explicitly add authentication information to your workflow\ndefinition. When making requests to a private endpoint, use OIDC to authenticate\nthrough IAP.\n\nTo make an HTTP request using OIDC, add an `auth` section to the `args` section\nof your workflow's definition, after you specify the URL.\n\n\u003cbr /\u003e\n\n### YAML\n\n```yaml\n - step_A:\n call: http.get\n args:\n url: https://www.example.com/endpoint\n body:\n someValue: \"Hello World\"\n anotherValue: 123\n auth:\n type: OIDC\n audience: OIDC_AUDIENCE\n \n```\n\n### JSON\n\n```json\n [\n {\n \"step_A\": {\n \"call\": \"http.get\",\n \"args\": {\n \"url\": \"https://www.example.com/endpoint\",\n \"body\": {\n \"someValue\": \"Hello World\",\n \"anotherValue\": 123\n },\n \"auth\": {\n \"type\": \"OIDC\",\n \"audience\": \"\u003cvar translate=\"no\"\u003eOIDC_AUDIENCE\u003c/var\u003e\"\n }\n }\n }\n }\n ]\n \n```\n\n\u003cbr /\u003e\n\nYou can use the `audience` parameter to specify the OIDC audience for the token.\nWhen invoking an IAP-enabled endpoint, you must specify the\nOAuth 2.0 client ID that you have configured for your application. This can be\nobtained from the [Credentials page](https://console.cloud.google.com/apis/credentials).\n\nWhat's next\n-----------\n\n- [Grant a workflow permission to access Google Cloud resources](/workflows/docs/authentication)\n- [Access HTTP response data saved in a variable](/workflows/docs/http-requests#access-data)"]]