You can enable or disable the collecting of events from Google sources for a specific bus.
Events from Google sources are directly triggered by an unmediated event such as the creation of a Cloud Run function or a status change to a Dataflow job. For more information, see Google event types supported by Eventarc.
Enable events from Google sources
You can enable the publishing of Google source events in the Google Cloud console or by using the Google Cloud CLI.
Console
In the Google Cloud console, go to the Eventarc > Bus page.
You can create a bus or, if you are updating a bus, click Edit.
On the Edit bus page, to add a message source, click
Add source.- In the Add message source pane, for the Google API message
provider, accept the default of
google-api-source
or enter a different source name. Click Create.
Note that only events from resources in the same Google Cloud project as the bus are published.
- In the Add message source pane, for the Google API message
provider, accept the default of
Click Save.
gcloud
Open a terminal.
You can enable events from Google sources by using the
gcloud beta eventarc google-api-sources create
command:gcloud beta eventarc google-api-source create GOOGLE_API_SOURCE_NAME \ --destination-message-bus=BUS_NAME \ --destination-message-bus-project=PROJECT_ID
Note that only events from resources in the same Google Cloud project as the bus are published.
Replace the following:
GOOGLE_API_SOURCE_NAME
: the ID or fully qualified identifier of yourGoogleApiSource
resource which represents a subscription to Google API events for a particular busBUS_NAME
: the ID or fully qualified identifier of the bus for which you want to subscribe to Google API eventsPROJECT_ID
: the Google Cloud project ID for the bus
Optional: You can also use the following flags:
--async
to return from the command immediately, without waiting for the operation in progress to complete.--crypto-key
to specify the fully qualified name of a customer-managed encryption key; if unspecified, Google-owned and managed keys are used.--logging-config
to configure the logging level which must be one of the following:NONE
,DEBUG
,INFO
,NOTICE
,WARNING
,ERROR
,CRITICAL
,ALERT
,EMERGENCY
.
Disable events from Google sources
You can disable the publishing of Google source events in the Google Cloud console or by using the gcloud CLI.
Console
In the Google Cloud console, go to the Eventarc > Bus page.
Click the name of the bus that you want to edit.
The Bus details page opens.
Click
Edit.On the Edit bus page, to delete the Google API message provider, click
Delete resource for the google-api-source message source (or the name you have given it).At the Delete resource prompt, click Confirm.
Google source events from resources in the same Google Cloud project as the bus are no longer collected and published.
Click Save.
gcloud
Open a terminal.
You can disable events from Google sources by using the
gcloud beta eventarc google-api-sources delete
command:gcloud beta eventarc google-api-source delete GOOGLE_API_SOURCE_NAME \ --location=REGION
Replace the following:
GOOGLE_API_SOURCE_NAME
: the ID or fully qualified identifier of yourGoogleApiSource
resource which represents a subscription to Google API events for a particular busREGION
: a supported location for the busAlternatively, you can set the Google Cloud CLI location property:
gcloud config set eventarc/location REGION
Google source events from resources in the same Google Cloud project as the bus are no longer collected and published.