gdcloud iam service-accounts GROUP | COMMAND [flags]
說明
建立、列出及刪除專案的服務帳戶,或授予專案服務帳戶的權限。子指令群組「gdcloud iam service-accounts keys」可管理服務帳戶的憑證。您必須在專案中具備「project-iam-admin」角色,才能管理該專案的服務帳戶和金鑰。
範例
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
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
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\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"]]