Build Event-Driven Applications with Eventarc

목록
- Pub/Sub: Qwik Start - Command Line
- Cloud Run Functions: Qwik Start
- Eventarc for Cloud Run
- Build Event-Driven Applications with Eventarc: Challenge Lab ⬅️ 오늘의 Lab!

export PROJECT_ID=$(gcloud config get-value project)
export REGION=<실습 REGION 입력>

gcloud services enable \
eventarc.googleapis.com \
run.googleapis.com \
pubsub.googleapis.com \
cloudbuild.googleapis.com \
logging.googleapis.com

# 주제
gcloud pubsub topics create $PROJECT_ID-topic
# 구독
gcloud pubsub subscriptions create $PROJECT_ID-topic-sub --topic=$PROJECT_ID-topic

gcloud run deploy pubsub-events \
--image=gcr.io/cloudrun/hello \
--platform=managed \
--region=$REGION \
--allow-unauthenticated
✅ hello 이미지를 사용하여 pubsub-events 서비스 만들기

gcloud eventarc triggers create pubsub-events-trigger \
--destination-run-service=pubsub-events \
--destination-run-region=$REGION \
--event-filters="type=google.cloud.pubsub.topic.v1.messagePublished" \
--location=$REGION \
--transport-topic=$PROJECT_ID-topic

gcloud pubsub topics publish $PROJECT_ID-topic --message="Hello from Eventarc!"
gcloud logging read "resource.type=cloud_run_revision AND resource.labels.service_name=pubsub-events" --limit=5