בדף הזה מוסבר על אפשרויות בקרת הגישה שזמינות לכם ב-Eventarc.
סקירה כללית
Eventarc משתמש בניהול זהויות והרשאות גישה (IAM) לצורך בקרת גישה.
במאמר ניהול הגישה לפרויקטים, לתיקיות ולארגונים מוסבר איך מעניקים ומבטלים גישה באמצעות כללי מדיניות הרשאה.
בסעיפים הבאים מפורטות רשימות של ההרשאות והתפקידים שנתמכים ב-Eventarc.
סוכן שירות של Eventarc
לחלק מה Google Cloud שירותים יש סוכני שירות שמאפשרים לשירות לגשת למשאבים שלכם אם ניתנות להם ההרשאות המתאימות. אם API מסוים דורש סוכן שירות, אז Google Cloud יוצר את סוכן השירות בשלב מסוים אחרי שמפעילים את ה-API ומשתמשים בו.
Eventarc משתמש במודל הקצאת משאבים שיוצר את סוכן השירות שלו רק כשצריך אותו בפעם הראשונה – למשל, כשיוצרים משאב Eventarc בפעם הראשונה – ולא כשמפעילים את ה-API בפעם הראשונה. יכולות לחלוף כמה דקות עד שהקצאת ההרשאות לסוכן השירות והפצת השינויים במערכת יסתיימו. מידע נוסף על העיכוב הזה זמין במאמר שגיאות שקשורות לסירוב הרשאה.
הפעלת ממשקי ה-API של Eventarc
כדי להציג ולהקצות תפקידי IAM ל-Eventarc, צריך להפעיל את ממשקי ה-API של Eventarc בפרויקט. לא תוכלו לראות את התפקידים של Eventarc במסוף עד שתפעילו את ממשקי ה-API. Google Cloud
המסוף
- נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud, צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Eventarc and Eventarc Publishing APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Eventarc and Eventarc Publishing APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.
gcloud
- נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud, צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
-
התקינו את ה-CLI של Google Cloud.
-
אם אתם משתמשים בספק זהויות חיצוני (IdP), קודם אתם צריכים להיכנס ל-CLI של gcloud באמצעות המאגר המאוחד לניהול זהויות.
-
כדי לאתחל את ה-CLI של gcloud, הריצו את הפקודה הבאה:
gcloud init -
יוצרים או בוחרים Google Cloud פרויקט.
תפקידים שנדרשים כדי לבחור או ליצור פרויקט
- Select a project: כדי לבחור פרויקט לא צריך תפקיד IAM ספציפי – אפשר לבחור כל פרויקט שקיבלתם בו תפקיד.
-
יצירת פרויקט: כדי ליצור פרויקט, צריך את התפקיד Project Creator (יצירת פרויקטים) (
roles/resourcemanager.projectCreator), שכולל את ההרשאהresourcemanager.projects.create. איך מקצים תפקידים
-
יוצרים Google Cloud פרויקט:
gcloud projects create PROJECT_ID
מחליפים את
PROJECT_IDבשם של פרויקט Google Cloud שיוצרים. -
בוחרים את הפרויקט שיצרתם: Google Cloud
gcloud config set project PROJECT_ID
מחליפים את
PROJECT_IDבשם הפרויקט ב- Google Cloud .
מפעילים את ממשקי ה-API של Eventarc ו-Eventarc Publishing:
תפקידים שנדרשים להפעלת ממשקי API
כדי להפעיל ממשקי API, צריך את תפקיד ה-IAM 'אדמין של Service Usage' (
roles/serviceusage.serviceUsageAdmin), שכולל את ההרשאהserviceusage.services.enable. איך מקצים תפקידיםgcloud services enable eventarc.googleapis.com
eventarcpublishing.googleapis.com -
התקינו את ה-CLI של Google Cloud.
-
אם אתם משתמשים בספק זהויות חיצוני (IdP), קודם אתם צריכים להיכנס ל-CLI של gcloud באמצעות המאגר המאוחד לניהול זהויות.
-
כדי לאתחל את ה-CLI של gcloud, הריצו את הפקודה הבאה:
gcloud init -
יוצרים או בוחרים Google Cloud פרויקט.
תפקידים שנדרשים כדי לבחור או ליצור פרויקט
- Select a project: כדי לבחור פרויקט לא צריך תפקיד IAM ספציפי – אפשר לבחור כל פרויקט שקיבלתם בו תפקיד.
-
יצירת פרויקט: כדי ליצור פרויקט, צריך את התפקיד Project Creator (יצירת פרויקטים) (
roles/resourcemanager.projectCreator), שכולל את ההרשאהresourcemanager.projects.create. איך מקצים תפקידים
-
יוצרים Google Cloud פרויקט:
gcloud projects create PROJECT_ID
מחליפים את
PROJECT_IDבשם של פרויקט Google Cloud שיוצרים. -
בוחרים את הפרויקט שיצרתם: Google Cloud
gcloud config set project PROJECT_ID
מחליפים את
PROJECT_IDבשם הפרויקט ב- Google Cloud .
מפעילים את ממשקי ה-API של Eventarc ו-Eventarc Publishing:
תפקידים שנדרשים להפעלת ממשקי API
כדי להפעיל ממשקי API, צריך את תפקיד ה-IAM 'אדמין של Service Usage' (
roles/serviceusage.serviceUsageAdmin), שכולל את ההרשאהserviceusage.services.enable. איך מקצים תפקידיםgcloud services enable eventarc.googleapis.com
eventarcpublishing.googleapis.com
תפקידים מוגדרים מראש
בטבלה הבאה מפורטים התפקידים המוגדרים מראש ב-IAM של Eventarc, עם רשימה של כל ההרשאות שכל תפקיד כולל.
התפקידים שמוגדרים מראש מתאימים לרוב התרחישים הנפוצים. אם התפקידים המוגדרים מראש לא מתאימים לתרחיש השימוש שלכם, תוכלו ליצור תפקיד IAM בהתאמה אישית.
תפקידים ב-Eventarc
| Role | Permissions |
|---|---|
Eventarc Admin( Full control over all Eventarc resources. Lowest-level resources where you can grant this role:
|
|
Eventarc Editor( Editor role for eventarc |
|
Eventarc Event Receiver( Can receive events from all event providers. Lowest-level resources where you can grant this role:
|
|
Eventarc Viewer( Can view the state of all Eventarc resources, including IAM policies. Lowest-level resources where you can grant this role:
|
|
Eventarc Connection Publisher Beta( Can publish events to Eventarc channel connections. Lowest-level resources where you can grant this role:
|
|
Eventarc Developer( Access to read and write Eventarc resources. Lowest-level resources where you can grant this role:
|
|
Eventarc Message Bus Admin( Full control over Message Buses resources. |
|
Eventarc Message Bus User( Access to publish to or bind to a Message Bus. |
|
Eventarc Event Collector Beta( Can collect events from multiple projects in an org for a source resource. |
|
Eventarc Publisher Beta( Can publish events to Eventarc channels. Lowest-level resources where you can grant this role:
|
|
Service agent roles
Service agent roles should only be granted to service agents.
| Role | Permissions |
|---|---|
Eventarc Service Agent( Gives Eventarc service account access to managed resources. |
|
ניהול IAM ברמת הפרויקט
ברמת הפרויקט, אפשר להקצות, לשנות ולבטל תפקידי IAM באמצעות מסוף Google Cloud , ה-API של IAM או Google Cloud CLI. הוראות מפורטות זמינות במאמר ניהול הגישה לפרויקטים, לתיקיות ולארגונים.