GCLOUD_IAM_SERVICE-ACCOUNTS_ADD-IAM-POLICY-BINDING(1)

NAME

gcloud iam service-accounts add-iam-policy-binding - add IAM policy binding for a service account

SYNOPSIS

gcloud iam service-accounts add-iam-policy-binding SERVICE_ACCOUNT --member=MEMBER --role=ROLE [GCLOUD_WIDE_FLAG ...]

DESCRIPTION
This command adds a policy binding to the IAM policy of a service account, given an IAM_ACCOUNT and the binding.

POSITIONAL ARGUMENTS

    SERVICE_ACCOUNT
        The service account whose policy to add bindings to. The account should be formatted as an email, like this: my-iam-account@somedomain.com.

REQUIRED FLAGS

    --member=MEMBER
        The member to add to the binding. Should be of the form user:user_email (e.g. user:test-user@gmail.com.)

    --role=ROLE
        Define the role of the member.

GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.

EXAMPLES
The following command will add an IAM policy binding for the role of 'roles/editor' for the user 'test-user@gmail.com' on a service account with identifier 'my-iam-account@somedomain.com'
    $ gcloud iam service-accounts add-iam-policy-binding \
        my-iam-account@somedomain.com \
        --member='user:test-user@gmail.com' --role='roles/editor'
See https://cloud.google.com/iam/docs/managing-policies for details of policy role and member types.