Granting Log Export Permissions in Google Cloud
Short answer
A Grant the team members the IAM role of logging.configWriter on Cloud IAM.
Question
Key Takeaways
The core trap is confusing 'exporting' (creating a sink) with 'reading' logs; only the configWriter role provides the necessary write access to create sinks without granting broader read/write log permissions.
To enable users to export logs via sinks, you must grant the logging.configWriter IAM role. This question tests the specific permissions required for managing log sinks versus general log access.
Common mistake: Learners often choose Option C (custom role with list/get), but these are read-only permissions that do not allow creating or modifying sinks, which is required for exporting.
Expert Analysis
Why the Answer Is Correct
Correct answer: A — Grant the team members the IAM role of logging.configWriter on Cloud IAM. The logging.configWriter role (roles/logging.configWriter) explicitly grants permissions to manage log-based metrics and sinks. Since exporting logs in Google Cloud involves creating and configuring sinks, this role provides the necessary permissions to perform that action. It allows users to create, update, and delete sinks, which is the mechanism for exporting logs.Why the Other Options Are Wrong
Option B (Access Context Manager) is used for network-level access control based on device state and user attributes, not for granular API permissions like log export. Option C suggests using logging.sinks.list and logging.sink.get, which are read-only permissions; they allow viewing existing sinks but do not permit creating new ones. Option D (Organizational Policy) is used to constrain organization-wide configurations, not to grant individual user permissions for specific actions.Community Comment Notes
Community consensus strongly favors Option A. As noted by user rinkeshgala1, the logging.configWriter role is the standard way to handle this. User Goram113 correctly points out that C is wrong because it lacks the create permission. User Manh emphasizes that while C follows least privilege for reading, it fails to provide the actual ability to export (create) logs. User irocketsoldier highlights the distinction between needing to export vs just read, confirming A is the correct choice for export functionality.Official Reference
https://cloud.google.com/logging/docs/access-control#logging.config_writer
This link opens the official vendor documentation in a new tab.
Exam Strategy
Always distinguish between read-only permissions (list, get) and write/create permissions when questions involve 'exporting', 'creating', or 'configuring'. For log exports, remember that sinks are resources that must be created, requiring write access to the sink configuration.
Frequently Asked Questions
Why isn't a custom role with logging.sinks.create sufficient?
Can I use logging.viewer role to export logs?
Discussion 22 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 22
-
Goram113 👍 11logging.sinks.create is needed to export logs - this is why C is wrong
-
Manh 👍 8It's should be C. least privilege The question is ask about export log and does not mention about read and write log Option A give too many permission Logs Configuration Writer (roles/logging.configWriter) Provides permissions to read and write the configurations of logs-based metrics and sinks for exporting logs. logging.buckets.create logging.buckets.delete logging.buckets.get logging.buckets.list logging.buckets.undelete logging.buckets.update logging.cmekSettings. logging.exclusions. logging.locations. logging.logMetrics. logging.logServiceIndexes. logging.logServices. logging.logs.list logging.notificationRules. logging.operations. logging.sinks.* logging.views.create logging.views.delete logging.views.get logging.views.list logging.views.update resourcemanager.projects.get resourcemanager.projects.list
-
irocketsoldier 👍 6I understand that option A gives the ability to export logs, but isn't C the best option following the least privilege principle since the question only says that the team members needs to export logs and not to write them?
-
akg001 👍 5agree for the A.
-
not_thanos 👍 4Write answer is A as stated in the documentation here https://cloud.google.com/logging/docs/export/configure_export_v2#before-you-begin "Note that this guide describes creating and managing sinks at the Cloud project level, but you can create sinks (non-aggregated) for billing accounts, folders, and organizations. As you get started, ensure the following: You have a Google Cloud project with logs that you can see in the Logs Explorer. You have one of the following IAM roles for the source Cloud project from which you're routing logs. Owner (roles/owner) Logging Admin (roles/logging.admin) Logs Configuration Writer (roles/logging.configWriter) The permissions contained in these roles allow you to create, delete, or modify sinks. For information on setting IAM roles, see the Logging Access control guide."
Show 17 more comments
-
sticky 👍 4A is correct Logs Configuration Writer (roles/logging.configWriter) - Provides permissions to read and write the configurations of logs-based metrics and sinks for exporting logs. https://cloud.google.com/logging/docs/access-control
-
cloudbee 👍 3https://cloud.google.com/logging/docs/export/configure_export_v2#before-you-begin A is the answer
-
giammydell 👍 3but C could follow the least privilege priciple
-
Sreedharveluru 👍 3 Answered AThere is no such thing called logging.sink.get
-
Manh 👍 2After review again, Ans A had enough permission to export log https://cloud.google.com/logging/docs/routing/overview
-
BlackCoffee 👍 1 Answered ANot C Custom roles can be used, but the permissions logging.sinks.list and logging.sink.get only allow team members to view existing sinks, not create or modify them to set up a new export. To create exports, permissions like logging.sinks.create are required.
-
Epic_rose 👍 1 Answered Aroles/logging.configWriter (Logs Configuration Writer) gives you the permissions to create log-based metrics, exclusions, buckets, and views, and to use sinks. To use the Logs Explorer (console) for these actions, add roles/logging.viewer.
-
zygomar 👍 1 Answered Ain addition to other comments here, C would be too restrictive. User new to have logs list permissions at least to know which logs to export. Goram113 also indicate that logging.sinks.create is needed to export logs hence why C is wrong
-
hanweiCN 👍 1ability to use sinks Add logging.sinks.{list, create, get, update, delete} , the list, get function can only have view permission. can not create sinks to export logs. u need create sink to export logs.
-
Trony 👍 1I agree. logging.configWriter (answer A) gives too much power to the team members. We only need to give them the rights to export, not change the whole logging configuration. C is ok.
-
GaneshSurwase 👍 1correct ans is A Logs Configuration Writer (roles/logging.configWriter) Provides permissions to read and write the configurations of logs-based metrics and sinks for exporting logs.
-
Shasha1 👍 1A Logs configuration writer can access to configure log exporting and metrics
-
PhilipKoku 👍 1 Answered CC - Use principle of minimum access required to fulfill the requirements
-
ric79 👍 1What is the minimum set of privs in order to export logs?
-
vijaigcp 👍 1 Answered AAgree with A
-
kleranti 👍 1 Answered Coption c
-
Ananda 👍 1 Answered AOption A
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All PCDOE Questions
Access 75 questions with complete answers and detailed explanations.
View Full PCDOE Practice Test →