본문 바로가기

Infra/Google Cloud

[Google Cloud] Google Study Jam : Monitor and Manage Google Cloud Resources (3)

728x90
반응형
본 포스트는 2024년 Google Study Jam을 공부하면서 개인적으로 내용을 정리한 포스트 입니다.

 

 

Cloud Function - Task 1. Create a Function

Navigation menu > VIEW ALL PRODUCTS > Serverless > Cloud Run Function > Create Function에서 다음 값에 맞게 함수를 생성한다.

Field Value
Environment Cloud Run function
Function name GCFunction
Region REGION
Trigger type HTTPS
Authentication Allow unauthenticated invocations
Memory allocated (In Runtime, Build, Connections and Security Settings) Keep it default
Autoscaling Set the Maximum number of instance to 5 and then click Next

Cloud Function - Task 2. Deploy the Function

Create function dialog에서 소스코드 편집기로 index.js에 구현된 helloWorld 함수 구현을 사용한다.

 

Deploy 버튼을 눌러 함수를 배포한다.

 

콘솔이 Cloud Functions Overview로 리다이렉트 된다.

 

Cloud Function - Task 3. Test the function

 

Cloud Functions Overview 페이지에서 GCFunction을 누른다.

 

TESTING 탭을 클릭

{} 안에 다음 코드를 작성

"message":"Hello World!"

 

TEST THE FUNCTION을 누르고 밑에 Logs에 200 Success가 나오면 성공

Cloud Function - Task 4. View logs

Cloud Function Overview 페이지로 이동하고 함수의 Action에서 View logs를 누르면 log history를 볼 수 있다.

 

 

728x90
반응형