2.Сreation accounts to work with cloud services When you create a service account, you must provide an alphanumeric ID (SA_NAME in the samples below), such as my-service-account. The ID must be between 6 and 30 characters, and can contain lowercase alphanumeric characters and dashes. After you create a service account, you cannot change its name.
The service account's name appears in the email address that is provisioned during creation, in the format SA_NAME@PROJECT_ID.iam.gserviceaccount.com.
Each service account also has a permanent, unique numeric ID, which is generated automatically.
You also provide the following information when you create a service account:
SA_DESCRIPTION is an optional description for the service account.
SA_DISPLAY_NAME is a friendly name for the service account.
PROJECT_ID is the ID of your Google Cloud project.
After you create a service account, you might need to wait for 60 seconds or more before you use the service account. This behavior occurs because read operations are eventually consistent; it can take time for the new service account to become visible. If you try to read or use a service account immediately after you create it, and you receive an error, you can retry the request with exponential backoff.
ConsolegcloudRESTC++C#GoJavaPython
In the Google Cloud console, go to the Create service account page.
Go to Create service account
schoolThe remaining steps will appear automatically in the Google Cloud console.
Select a Cloud project.
Enter a service account name to display in the Google Cloud console.
The Google Cloud console generates a service account ID based on this name. Edit the ID if necessary. You cannot change the ID later.
Optional: Enter a description of the service account.
If you don't want to set access controls now, click Done to finish creating the service account. To set access controls now, click Create and continue and continue to the next step.
Optional: Choose one or more IAM roles to grant to the service account on the project.
When you are done adding roles, click Continue.
Optional: In the Service account users role field, add members that can impersonate the service account.
Optional: In the Service account admins role field, add members that can manage the service account.
Click Done to finish creating the service account.
After you create a service account, grant one or more roles to the service account so that it can act on your behalf.
Also, if the service account needs to access resources in other projects, you usually must enable the APIs for those resources in the project where you created the service account.
What's next
Learn how to list and edit service accounts.
Review the process for granting IAM roles to all types of principals, including service accounts.
Understand how to attach service accounts to resources.