--- title: "트리거 추가" slug: "cloudfunctions-example04" tags: ["트리거와 액션 연결"] updated: 2026-10-22T09:12:13Z published: 2026-10-22T09:12:13Z canonical: "guide-gov.ncloud-docs.com/cloudfunctions-example04" --- > ## Documentation Index > Fetch the complete documentation index at: https://guide-gov.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # 트리거 추가 Classic 환경에서 이용 가능합니다 . 액션을 실행할 트리거를 추가하는 방법에 대한 이해에 도움을 줄 수 있는 예제를 소개합니다. 이 예제는 사용자의 위치를 업데이트하는 트리거를 생성하고 사용자의 위치가 업데이트될 때 hello 액션을 호출하는 내용입니다. 예제 학습 시 다음의 가이드를 참고해 주십시오. - 액션 생성 방법 - Cloud Functions 사용 > Action > 액션 생성 ## 액션 생성 1. 이름과 장소를 전달받아 출력하는 소스 코드를 작성해 주십시오. ``` function main(params) { return {payload: 'Hello, ' + params.name + ' from ' + params.place}; } ``` 1. 1.에서 작성한 소스 코드를 사용하여 콘솔에서 액션을 생성해 주십시오. ![cloudfunctions-example04_v2_01_ko](https://cdn.document360.io/f2d93c92-8957-408f-94df-b9b370f76a32/Images/Documentation/cloudfunctions-example04_v2_01_ko.png?sv=2026-02-06&spr=https&st=2026-11-07T16%3A56%3A43Z&se=2026-11-07T17%3A56%3A43Z&sr=c&sp=r&sig=uminPM61ARcyJTfOZE%2BB%2BZsYSFULnVaY64ReN6trXaE%3D) ## 트리거 추가 액션을 실행하는 트리거를 추가하는 순서는 다음과 같습니다. 1. 콘솔에서 생성한 helloAction이라는 이름의 액션을 선택하여 상세 정보로 이동해 주십시오. ![cloudfunctions-example04_v2_02_ko](https://cdn.document360.io/f2d93c92-8957-408f-94df-b9b370f76a32/Images/Documentation/cloudfunctions-example04_v2_02_ko.png?sv=2026-02-06&spr=https&st=2026-11-07T16%3A56%3A43Z&se=2026-11-07T17%3A56%3A43Z&sr=c&sp=r&sig=uminPM61ARcyJTfOZE%2BB%2BZsYSFULnVaY64ReN6trXaE%3D) 2. 트리거 항목의 **[추가]** 버튼을 클릭해 주십시오. 3. 연결 방법으로 **신규 생성**을 선택하고 타입으로 **API Gateway**를 선택해 주십시오. ![cloudfunctions-example04_v2_03_ko](https://cdn.document360.io/f2d93c92-8957-408f-94df-b9b370f76a32/Images/Documentation/cloudfunctions-example04_v2_03_ko.png?sv=2026-02-06&spr=https&st=2026-11-07T16%3A56%3A43Z&se=2026-11-07T17%3A56%3A43Z&sr=c&sp=r&sig=uminPM61ARcyJTfOZE%2BB%2BZsYSFULnVaY64ReN6trXaE%3D) 4. API Gateway를 통해 액션을 호출할 API Gateway의 엔드포인트 생성을 위한 설정을 해 주십시오. ![cloudfunctions-example04_v2_04_ko](https://cdn.document360.io/f2d93c92-8957-408f-94df-b9b370f76a32/Images/Documentation/cloudfunctions-example04_v2_04_ko.png?sv=2026-02-06&spr=https&st=2026-11-07T16%3A56%3A43Z&se=2026-11-07T17%3A56%3A43Z&sr=c&sp=r&sig=uminPM61ARcyJTfOZE%2BB%2BZsYSFULnVaY64ReN6trXaE%3D) ## 실행 결과 확인 트리거를 실행하고 액션이 정상적으로 실행 되었는지 확인할 수 있습니다. 확인하는 순서는 다음과 같습니다. 1. API Gateway 엔드포인트를 호출하여 액션을 실행해 주십시오. 자세한 실행 방법은 [API Gateway 트리거의 트리거 실행](/docs/cloudfunctions-apigateway-classic#%ED%8A%B8%EB%A6%AC%EA%B1%B0%EC%8B%A4%ED%96%89)을 참조해 주십시오. ``` curl -X POST -H "Content-Type: application/json" https://func.apigw.gov-ntruss.com/api/v1/hello?blocking=true&result=true -d '{"name": "Cloud Functions", "place": "NAVER Cloud"}' ``` 1. 액션 상세 정보의 **모니터링** 탭 메뉴 화면에서 실행 결과에 대한 상세 정보를 확인해 주십시오. 가장 최근에 발생한 액티베이션 정보를 확인하여 액션 실행 여부를 확인하고 트리거로 인해 실행된 액션이 파라미터를 정상적으로 처리하는지 확인합니다. ![cloudfunctions-example04_v2_05_ko](https://cdn.document360.io/f2d93c92-8957-408f-94df-b9b370f76a32/Images/Documentation/cloudfunctions-example04_v2_05_ko.png?sv=2026-02-06&spr=https&st=2026-11-07T16%3A56%3A43Z&se=2026-11-07T17%3A56%3A43Z&sr=c&sp=r&sig=uminPM61ARcyJTfOZE%2BB%2BZsYSFULnVaY64ReN6trXaE%3D)