Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Compute Cloud
    • All guides
      • Configuring metadata service parameters
      • Getting VM instance metadata
      • Getting a VM instance identity document
      • Changing VM instance metadata
      • Creating a VM with a custom configuration script
      • Creating a VM with metadata from environment variables
      • Creating a VM instance with access to a Yandex Lockbox secret
    • Viewing operations with resources
    • Viewing metrics Monitoring
  • Yandex Container Solution
  • Access management
  • Pricing policy
  • Terraform reference
  • Metrics Monitoring
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Metadata
  3. Configuring metadata service parameters

Configuring parameters of the VM metadata service

Written by
Yandex Cloud
Updated at July 7, 2026
View in Markdown

You can configure parameters of the VM metadata service when creating or updating the VM.

To configure metadata service parameters for a VM:

CLI
Terraform
API

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder used by default is the one specified when creating 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.

  1. View the description of the CLI command for updating VM parameters:

    yc compute instance update --help
    
  2. Get a list of VMs in the default folder:

    yc compute instance list
    
  3. Select ID or NAME of the VM you need.

  4. Define the metadata service settings:

    yc compute instance update <VM_ID> \
      --metadata-options gce-http-endpoint=enabled
    

    Where --metadata-options is the parameter defining the settings of the VM metadata service. The possible values are:

    • gce-http-endpoint: Allows you to access metadata using the Google Compute Engine format. It can be either enabled or disabled.
    • gce-http-token: Allows you to get the service account IAM token for the VM using Google Compute Engine metadata. It can be either enabled or disabled.

    For more information, see VM instance metadata service parameters.

To configure parameters of the VM metadata service when creating the VM, use the --metadata-options parameter in the yc compute instance create command in the same way.

If you do not have Terraform yet, install it and configure the Yandex Cloud provider.

To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), authenticate using the appropriate method.

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the guides on the Terraform website or its mirror.

  1. Open the Terraform configuration file and specify the metadata_options parameter in the VM description:

    ...
    resource "yandex_compute_instance" "test-vm" {
      ... 
      metadata_options {
        gce_http_endpoint    = 0
        gce_http_token       = 0
      }
      ...
    }
    ...
    

    Where:

    • yandex_compute_instance: VM description:

      • metadata_options: Metadata parameters:
        • gce_http_endpoint: Allows you to access metadata using the Google Compute Engine format. Possible values: 0, 1 for enabled and 2 for disabled.
        • gce_http_token: Allows you to get the service account IAM token for the VM using Google Compute Engine metadata. Possible values: 0, 1 for enabled and 2 for disabled.

      For more information, see VM instance metadata service parameters.

    For more information about yandex_compute_instance properties in Terraform, see this provider guide.

  2. Create the resources:

    1. In the terminal, navigate to the configuration file directory.

    2. Make sure the configuration is correct using this command:

      terraform validate
      

      If the configuration is valid, you will get this message:

      Success! The configuration is valid.
      
    3. Run this command:

      terraform plan
      

      You will see a list of resources and their properties. No changes will be made at this step. Terraform will show any errors in the configuration.

    4. Apply the configuration changes:

      terraform apply
      
    5. Type yes and press Enter to confirm the changes.

    All the resources you need will then be created in the specified folder with the settings you defined. You can check the new resources and their settings using the management console or this CLI command:

    yc compute instance get <VM_name>
    

When creating a VM, use the create REST API method for the Instance resource or the InstanceService/Create gRPC API call.

When updating a VM, use the update REST API method for the Instance resource or the InstanceService/Update gRPC API call.

Was the article helpful?

Previous
Deleting a file storage
Next
Getting VM instance metadata
© 2026 Direct Cursus Technology L.L.C.