## NAME

gdcloud iam service-accounts add-iam-policy-binding - Grant a Role/ProjectRole/ClusterRole/OrganizationRole to a service account.

## SYNOPSIS

```text
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

```text

  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 --role-namespace=iam-test

    or

    gdcloud iam service-accounts add-iam-policy-binding --role=ProjectRole/pr-test --iam-account=psa-test --project=iam-test

    "--project" and "--role-namespace" flags are mutually exclusive.

```

### REQUIRED FLAGS

```text
      --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

```text
      --role-namespace string   Namespace of Role to bind with the service account. This is only applicable for multizone enabled environments. This is mutually exclusive with the --project flag
```

### GDCLOUD WIDE FLAGS

These flags are available to all commands: `--configuration`, `--format`, `--help`, `--project`, `--quiet`.

For more information, see the [gdcloud CLI reference overview](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/resources/gdcloud-reference/gdcloud.md.txt) page.