본문 바로가기
Cloud/Google Cloud Study Jam

Cloud Functions: Qwik Start - Console

by 사향낭 2022. 3. 23.

 

 

Cloud Functions: Qwik Start - Console | Google Cloud Skills Boost

이 실습에서는 Cloud Platform Console을 사용하여 Cloud 함수를 만들고 배포하는 방법을 보여줍니다. 짧은 동영상 <A HREF="https://youtu.be/_nYXeEe-hqc">Connect & Extend GCP Services with Google Cloud Functions(Google Cloud Func

www.cloudskillsboost.google

 

Cloud Functions은 serverless execution environment라고 한다.

 

어떤 event가 발생해 trigger를 작동시켜 미리 입력해놓은 function을 실행시켜준다고 한다.

 

 

 

문서에서 정의하는 event는 cloud environment 안에서 발생하는 것들이다.

 

database의 data의 변화가 있거나, storage system에 파일을 담는다거나, 새로운 vm machine instance가 생성되는 것들이다.

 

어떤 event에 관심이 있다는 것을 trigger을 통해 define 해줌으로써 function과 binding 하여 반응할 수 있게 한다.

 

그리고 그 기반 환경들을 Google에서 관리해주기 때문에 사용자는 이러한 일들을 신경쓸 필요가 없는 serverless라고 한다.

 

이제 실습을 해보자!

 

 

Cloud Console에 접속하여 Navigation menu -> Cloud Functions -> Create Functions

 

 

주어진 조건으로 설정하고 deploy 버튼을 누르면 로딩 후에 초록색 체크 모양으로 cloud function이 활성화되어 있는 것을 확인할 수 있다.

 

 

test를 위해 Test Function 버튼 클릭

 

 

bracket {} 안에 다음 text를 넣어주자

 

"message": "Hello World!"

 

 

Output 필드와 Logs 필드에서 message가 성공적으로 보내진 것을 확인할 수 있다.

 

 

 

Cloud Functions Overview 페이지로 돌아가 View Logs 클릭

 

 

 

Query results에서 로그를 확인할 수 있다.

 

댓글