professional-cloud-data-engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
An enterprise data engineering team processes streaming events using Cloud Dataflow and manages batch pipelines using Cloud Dataproc. To satisfy security audit requirements and analyze system health, the team creates a custom Log Router sink configured to route Dataflow and Dataproc execution and audit logs into a BigQuery dataset residing in a centralized observability project.
After creating the log sink, the team notices that log entries are not appearing in the destination BigQuery dataset.
Which action should the data engineer take to enable the log sink to export logs successfully?
When you create a log sink in Cloud Logging that routes log entries to another destination (such as a BigQuery dataset, Cloud Storage bucket, or Pub/Sub topic), Cloud Logging creates or assigns a dedicated service account represented in the writerIdentity field of the sink configuration. This identity acts on behalf of the Log Router to deliver logs to external or cross-project resources.
writerIdentity principal requires permissions to insert records into tables and create underlying log tables, which is provided by the BigQuery Data Editor (roles/bigquery.dataEditor) role.gcloud logging sinks describe SINK_NAME reveals the assigned service account (e.g., serviceAccount:service-123456789012@gcp-sa-logging.iam.gserviceaccount.com), which can then be granted the necessary role via IAM policy bindings on the target dataset or project.Granting the specific destination role (roles/bigquery.dataEditor) directly to the sink's writerIdentity satisfies the exact IAM requirement needed for the Log Router to push data into BigQuery without granting unnecessary project-level owner permissions.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.