GCLOUD_COMPUTE_INSTANCES_SET-SERVICE-ACCOUNT(1)

NAME

gcloud compute instances set-service-account - set service account and scopes for a Google Compute Engine instance

SYNOPSIS

gcloud compute instances set-service-account INSTANCE_NAME [--zone=ZONE] [--no-scopes | --scopes=[SCOPE,...]] [--no-service-account | --service-account=SERVICE_ACCOUNT] [GCLOUD_WIDE_FLAG ...]

DESCRIPTION
Set service account and scopes for a Google Compute Engine instance.

POSITIONAL ARGUMENTS

    INSTANCE_NAME
        The name of the instance to operate on.

FLAGS

    --zone=ZONE
        The zone of the instance to operate on. If not specified, you may be prompted to select a zone. gcloud will attempt to identify the zone by searching for resources in your project. If the zone cannot be determined, you will then be prompted with all Google Cloud Platform zones. To avoid prompting when this flag is omitted, you can set the compute/zone property:
        $ gcloud config set compute/zone ZONE
    A list of zones can be fetched by running:
        $ gcloud compute zones list
    To unset the property, run:
        $ gcloud config unset compute/zone
    Alternatively, the zone can be stored in the environment variable CLOUDSDK_COMPUTE_ZONE.

At most one of these may be specified:

    --no-scopes
        Remove all scopes from the instance

    --scopes=[SCOPE,...]
        If not provided, the instance will keep the scopes it currently has. SCOPE can be either the full URI of the scope or an alias. Available aliases are:
        default
          Scopes assigned to instances by default:
          - https://www.googleapis.com/auth/cloud.useraccounts.readonly
          - https://www.googleapis.com/auth/devstorage.read_only
          - https://www.googleapis.com/auth/logging.write
          - https://www.googleapis.com/auth/monitoring.write
          - https://www.googleapis.com/auth/pubsub
          - https://www.googleapis.com/auth/service.management.readonly
          - https://www.googleapis.com/auth/servicecontrol
          - https://www.googleapis.com/auth/trace.append
        bigquery
          - https://www.googleapis.com/auth/bigquery
        cloud-platform
          - https://www.googleapis.com/auth/cloud-platform
        compute-ro
          - https://www.googleapis.com/auth/compute.readonly
        compute-rw
          - https://www.googleapis.com/auth/compute
        datastore
          - https://www.googleapis.com/auth/datastore
        logging-write
          - https://www.googleapis.com/auth/logging.write
        monitoring
          - https://www.googleapis.com/auth/monitoring
        monitoring-write
          - https://www.googleapis.com/auth/monitoring.write
        service-control
          - https://www.googleapis.com/auth/servicecontrol
        service-management
          - https://www.googleapis.com/auth/service.management.readonly
        sql (DEPRECATED)
          - https://www.googleapis.com/auth/sqlservice:
        sql-admin
          - https://www.googleapis.com/auth/sqlservice.admin
        storage-full
          - https://www.googleapis.com/auth/devstorage.full_control
        storage-ro
          - https://www.googleapis.com/auth/devstorage.read_only
        storage-rw
          - https://www.googleapis.com/auth/devstorage.read_write
        taskqueue
          - https://www.googleapis.com/auth/taskqueue
        useraccounts-ro
          - https://www.googleapis.com/auth/cloud.useraccounts.readonly
        useraccounts-rw
          - https://www.googleapis.com/auth/cloud.useraccounts
        userinfo-email
          - https://www.googleapis.com/auth/userinfo.email
    DEPRECATION WARNING: 'https://www.googleapis.com/auth/sqlservice' account scope and sql alias do not provide SQL instance management capabilities and have been deprecated. Please, use 'https://www.googleapis.com/auth/sqlservice.admin' or sql.admin to manage your Google SQL Service instances.

At most one of these may be specified:

    --no-service-account
        Remove service account from the instance

    --service-account=SERVICE_ACCOUNT
        A service account is an identity attached to the instance. Its access tokens can be accessed through the instance metadata server and are used to authenticate applications on the instance. The account can be either an email address or an alias corresponding to a service account. You can explicitly specify the Compute Engine default service account using the 'default' alias. If not provided, the instance will keep the service account it currently has.

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.