[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Step-by-step guides](../index.md) > Managing an instance group > Updating an instance group based on a YAML specification

# Updating an instance group based on a YAML specification

To update an [instance group](../../concepts/instance-groups/index.md) based on a YAML [specification](../../concepts/instance-groups/specification.md):

{% list tabs group=instructions %}

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  Run the command below, specifying the instance group name or ID and the YAML specification file path:
  
  ```bash
  yc compute instance-group update <instance_group_name_or_ID> --file specification.yaml
  ```

  For more information about the `yc compute instance-group update` command, see the [CLI reference](../../../cli/cli-ref/compute/cli-ref/instance-group/update.md).

- API {#api}

  Use the [updateFromYaml](../../instancegroup/api-ref/InstanceGroup/updateFromYaml.md) REST API method for the [InstanceGroup](../../instancegroup/api-ref/InstanceGroup/index.md) resource or the [InstanceGroupService/UpdateFromYaml](../../instancegroup/api-ref/grpc/InstanceGroup/updateFromYaml.md) gRPC API call.

  To request a list of available instance groups, use the [listInstances](../../instancegroup/api-ref/InstanceGroup/listInstances.md) REST API method or the [InstanceGroupService/ListInstances](../../instancegroup/api-ref/grpc/InstanceGroup/listInstances.md) gRPC API call.

{% endlist %}