GCLOUD_IAM_SERVICE-ACCOUNTS_SET-IAM-POLICY(1)

NAME

gcloud iam service-accounts set-iam-policy - set IAM policy for a service account

SYNOPSIS

gcloud iam service-accounts set-iam-policy IAM-ACCOUNT POLICY-FILE [GLOBAL-FLAG ...]

DESCRIPTION
This command sets the IAM policy for a service account, given an IAM-ACCOUNT and a file that contains the JSON encoded IAM policy.

POSITIONAL ARGUMENTS
IAM-ACCOUNT
    The service account whose policy to set.
POLICY-FILE
    Path to a local JSON formatted file containing a valid policy.

GLOBAL FLAGS
Run $ gcloud help for a description of flags available to all commands.

EXAMPLES
The following command will read an IAM policy defined in a JSON file 'policy.json' and set it for a service account with identifier 'my-iam-account@somedomain.com'
    $ gcloud iam service-accounts set-iam-policy \
        my-iam-account@somedomain.com policy.json
See https://cloud.google.com/iam/docs/managing-policies for details of the policy file format and contents.