gdcloud iam service-accounts add-iam-policy-binding
Stay organized with collections
Save and categorize content based on your preferences.
NAME
gdcloud iam service-accounts add-iam-policy-binding - Grant a Role/ProjectRole/ClusterRole/OrganizationRole to a service account.
SYNOPSIS
gdcloud iam service-accounts add-iam-policy-binding [flags]
DESCRIPTION
Grant a Role, ProjectRole, ClusterRole or OrganizationRole to a project's service account. The name of the binding will be auto generated so you don't need to provide a name.
EXAMPLES
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
REQUIRED FLAGS
--iam-account string Project's service account to bind with the role. The flag is required to run the command.
--role string Role to bind with the service account in the format of "RoleType/NAME" where RoleType is one of the Kubernetes type in Role, ProjectRole, ClusterRole or OrganizationRole, and NAME is the name of the role. The flag is required to run the command.
OPTIONAL FLAGS
--role-namespace string Namespace of Role to bind with the service account. This is only applicable for multizone enabled environments.
GDCLOUD WIDE FLAGS
These flags are available to all commands: --configuration, --format, --help, --project, --quiet.
[[["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-03-05 UTC."],[[["This command, `gdcloud iam service-accounts add-iam-policy-binding`, grants a specified role to a project's service account."],["The required flags are `--iam-account`, for specifying the target service account, and `--role`, for defining the role to be assigned."],["The `--role` flag requires the input to be in the format \"RoleType/NAME\", where RoleType is one of the following; Role, ProjectRole, ClusterRole or OrganizationRole."],["The command automatically generates a binding name, removing the need for user input on this parameter."],["An optional flag `--role-namespace` is available for multizone environments, allowing specification of the namespace of the Role."]]],[]]