Stay organized with collections
Save and categorize content based on your preferences.
NAME
gdcloud iam service-accounts - Manage project's service accounts and keys.
SYNOPSIS
gdcloud iam service-accounts GROUP | COMMAND [flags]
DESCRIPTION
Create, list, delete project's service accounts, or grant permissions for a project's service account. A subcommand group "gdcloud iam service-accounts keys" manages service accounts' credentials. You must have the "project-iam-admin" role in a project to manage the service accounts and keys for that project.
EXAMPLES
To list all the service accounts from project "iam-test", run:
gdcloud iam service-accounts list --project=iam-test
To create a service account of name "psa-test" for project "iam-test", run:
gdcloud iam service-accounts create psa-test --project=iam-test
To delete a service account of name "psa-test" from project "iam-test", run:
gdcloud iam service-accounts delete psa-test --project=iam-test
To grant the project role of name "pr-test" for project's service account "psa-test" in project "iam-test", run:
gdcloud iam service-accounts add-iam-policy-binding --role=ProjectRole/pr-test --iam-account=psa-test --project=iam-test
GDCLOUD WIDE FLAGS
These flags are available to all commands: --help.
add-iam-policy-binding
Grant a Role/ProjectRole/ClusterRole/OrganizationRole to a service account.
create
Create a new service account for a project.
delete
Delete a service account from a project.
list
List all the service accounts from a project
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003e\u003ccode\u003egdcloud iam service-accounts\u003c/code\u003e is a tool for managing service accounts and keys within a project.\u003c/p\u003e\n"],["\u003cp\u003eUsers can create, list, and delete service accounts using this tool.\u003c/p\u003e\n"],["\u003cp\u003ePermissions can be granted to service accounts using \u003ccode\u003eadd-iam-policy-binding\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ekeys\u003c/code\u003e group within this tool allows for managing service account credentials.\u003c/p\u003e\n"],["\u003cp\u003eYou need the "project-iam-admin" role to manage service accounts and their associated keys.\u003c/p\u003e\n"]]],[],null,["# gdcloud iam service-accounts\n\nNAME\n----\n\ngdcloud iam service-accounts - Manage project's service accounts and keys.\n\nSYNOPSIS\n--------\n\n gdcloud iam service-accounts GROUP | COMMAND [flags]\n\nDESCRIPTION\n-----------\n\nCreate, list, delete project's service accounts, or grant permissions for a project's service account. A subcommand group \"gdcloud iam service-accounts keys\" manages service accounts' credentials. You must have the \"project-iam-admin\" role in a project to manage the service accounts and keys for that project.\n\n### EXAMPLES\n\n\n To list all the service accounts from project \"iam-test\", run:\n\n gdcloud iam service-accounts list --project=iam-test\n\n To create a service account of name \"psa-test\" for project \"iam-test\", run:\n\n gdcloud iam service-accounts create psa-test --project=iam-test\n\n To delete a service account of name \"psa-test\" from project \"iam-test\", run:\n\n gdcloud iam service-accounts delete psa-test --project=iam-test\n\n To grant the project role of name \"pr-test\" for project's service account \"psa-test\" in project \"iam-test\", run:\n\n gdcloud iam service-accounts add-iam-policy-binding --role=ProjectRole/pr-test --iam-account=psa-test --project=iam-test\n\n### GDCLOUD WIDE FLAGS\n\nThese flags are available to all commands: `--help`.\n\nFor more information, see the [gdcloud CLI reference overview](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-reference/gdcloud) page.\n\n### GROUPS\n\n`GROUP` is one of the following: \n\n keys\n Manage keys for a project's service account.\n\n### COMMANDS\n\n`COMMAND` is one of the following: \n\n add-iam-policy-binding\n Grant a Role/ProjectRole/ClusterRole/OrganizationRole to a service account.\n create\n Create a new service account for a project.\n delete\n Delete a service account from a project.\n list\n List all the service accounts from a project"]]