1. Sign in to Google Cloud Console: Go to the Google Cloud Console and sign in with your GCP account.

  2. Navigate to IAM & Admin: Click on the menu icon on the top left corner of the console, then go to IAM & Admin > IAM.

  3. Select the project: If you have multiple projects, select the project where you want to create the service account from the dropdown menu at the top of the page.

  4. Create a new service account:

    • Click on the "+ Add" button at the top of the IAM page.

    • In the "New principals" section, click on "Service account".

    • Enter a name for your service account.

    • Optionally, you can add a description for the service account.

  5. Assign the Logs Viewer role:

    • In the "Role" dropdown menu, search for "Logs Viewer".

    • Select "Logs Viewer" from the list of roles.

  6. Generate the service account key:

    • After creating the service account and assigning the Logs Viewer role, click on "Create key" under the "Service account key" section.

    • Choose the key type as JSON.

    • Click on "Create" to generate and download the JSON key file.

Last updated