Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Serverless Containers
  • Comparison with other Yandex Cloud services
    • All guides
    • Getting an IAM token for a service account using a container
      • Getting a list of containers
      • Getting a list of container revisions
      • Getting information about a container
      • Getting information about a container revision
      • Configuring metadata service parameters
    • Viewing operations with service resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Getting information about a container
  3. Configuring metadata service parameters

Configuring metadata service parameters for a container

Written by
Yandex Cloud
Updated at April 22, 2025

You can configure metadata service parameters when creating a container revision.

Available options:

  • awsV1HttpEndpoint: Provides access to metadata using the AWS format (IMDSv1). It can be either enabled or disabled. If set to disabled, the metadata request will fail with error 404 Not Found. The default value is enabled.

    Note

    The awsV1HttpEndpoint parameter is enabled by default, but we recommend disabling it. The IMDSv1 format comes with a number of security vulnerabilities. Its most severe flaw is the high risk of attacks, such as SSRF. For more information, see the AWS official blog.

  • gceHttpEndpoint: Provides access to metadata using the Google Compute Engine format. It can be either enabled or disabled. If set to disabled, the metadata request will fail with error 404 Not Found. The default value is enabled.

Management console
CLI
Terraform
API
  1. In the management console, select the folder with your container.
  2. Select Serverless Containers.
  3. Select the container.
  4. Navigate to the Editor tab.
  5. Expand the Metadata service parameters section.
  6. Configure metadata service parameters for the container: Access metadata using the Google Compute Engine format and Access metadata using the AWS format (IMDSv1).
  7. Click Create revision.

To configure metadata service parameters for a container, run this command:

yc serverless container revision deploy \
  --container-id <container_ID> \
  --image <Docker_image_URL> \
  --service-account-id <service_account_ID>
  --metadata-options <option>=<enable_or_disabled>

Where:

  • --container-id: Container ID. To find out the ID, get a list of containers.
  • --image: Yandex Container Registry Docker image URL.
  • --service-account-id: ID of the service account with permissions to download a Docker image.
  • --metadata-options: Settings for the metadata service parameters, e.g., aws-v1-http-endpoint=disabled.

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 documentation on the Terraform website or mirror website.

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

To configure metadata service parameters for a container:

  1. Open the Terraform configuration file and add the metadata_options section to the container description:

    resource "yandex_serverless_container" "metadata_container" {
      name               = "<container_name>"
      memory             = "<RAM_size>"
      execution_timeout  = "<execution_timeout>"
      service_account_id = "<service_account_ID>"
      content {
        zip_filename = "<path_to_ZIP_archive>"
      }
    
      image {
        url = <container_image_path>
      }
    
      metadata_options {
        metadata_options.0.gce_http_endpoint = "0_or_1_or_2"
        metadata_options.0.aws_v1_http_endpoint = "0_or_1_or_2"
      }
    }
    

    Where:

    • metadata_options: Settings for the metadata service parameters, e.g., metadata_options.0.gce_http_endpoint = "1". Specify the following:
      • 0 if you want to keep the default value.
      • 1 to enable the parameter.
      • 2 to disable the parameter.

    For more information about the yandex_serverless_container resource parameters, see this Terraform article.

  2. Apply the changes:

    1. In the terminal, change to the folder where you edited the configuration file.

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

      terraform validate
      

      If the configuration is correct, the following message is returned:

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

      terraform plan
      

      The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.

    4. Apply the configuration changes:

      terraform apply
      
    5. Confirm the changes: type yes in the terminal and press Enter.

You can check that the container and its settings have changed using the management console or this CLI command:

yc serverless container revision get <container_revision_ID>

To conigure metadata service parameters for a container, use the deployRevision REST API method for the Container resource or the ContainerService/DeployRevision gRPC API call.

Was the article helpful?

Previous
Getting information about a container revision
Next
Making a container public
© 2025 Direct Cursus Technology L.L.C.