[Yandex Cloud documentation](../../index.md) > [Yandex Serverless Containers](../index.md) > [Step-by-step guides](index.md) > Getting container info > Configuring metadata service parameters

# Configuring metadata service parameters for a container

You can configure metadata service parameters when [creating a container revision](manage-revision.md).

The following options are available:

* `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 the `404 Not Found` error. The default value is `enabled`.

    {% note info %}

    `awsV1HttpEndpoint` 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](https://portswigger.net/web-security/ssrf). For more information, see the [AWS official blog](https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/).

    {% endnote %}

* `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 the `404 Not Found` error. The default value is `enabled`.

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../resource-manager/concepts/resources-hierarchy.md#folder) with your [container](../concepts/container.md).
  1. Navigate to **Serverless Containers**.
  1. Select the container.
  1. Navigate to the **Editor** tab.
  1. Expand the **Metadata service parameters** section.
  1. Configure metadata service parameters for the container: `Access metadata using the Google Compute Engine format` and `Access metadata using the AWS format (IMDSv1)`.
  1. Click **Create revision**.

- CLI {#cli}

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

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

    Where:
    * `--container-id`: Container ID. To find out the ID, [get](list.md) the list of containers.
    * `--image`: Yandex Container Registry Docker image URL.
    * `--service-account-id`: [ID of the service account](../../iam/operations/sa/get-id.md) with Docker image pull permissions.
    * `--metadata-options`: Settings for the metadata service parameters, e.g., `aws-v1-http-endpoint=disabled`.

- Terraform {#tf}

    With [Terraform](https://www.terraform.io/), 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](https://github.com/hashicorp/terraform/blob/main/LICENSE). The [Yandex Cloud provider for Terraform](https://github.com/yandex-cloud/terraform-provider-yandex) is distributed under the [MPL-2.0](https://www.mozilla.org/en-US/MPL/2.0/) license.
    
    For more information about the provider resources, see the relevant documentation on the [Terraform](https://www.terraform.io/docs/providers/yandex/index.html) website or [its mirror](../../terraform/index.md).

    If you do not have Terraform yet, [install it and configure the Yandex Cloud provider](../../tutorials/infrastructure-management/terraform-quickstart.md#install-terraform).
    
    
    To manage infrastructure using Terraform under a service account or user accounts (a Yandex account, a federated account, or a local user), [authenticate](../../terraform/authentication.md) using the appropriate method.

    To configure metadata service parameters for a container:

    1. Open the Terraform configuration file and add the `metadata_options` section to the container description:
      
        ```hcl
        resource "yandex_serverless_container" "metadata_container" {
          name               = "<container_name>"
          memory             = "<RAM_amount>"
          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 `yandex_serverless_container` properties, see [this provider guide](../../terraform/resources/serverless_container.md).

   1. Apply the changes:

      1. In the terminal, navigate to the configuration file directory.
      1. Make sure the configuration is correct using this command:
      
         ```bash
         terraform validate
         ```
      
         If the configuration is valid, you will get this message:
      
         ```bash
         Success! The configuration is valid.
         ```
      
      1. Run this command:
      
         ```bash
         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.
      1. Apply the configuration changes:
      
         ```bash
         terraform apply
         ```
      
      1. Type `yes` and press **Enter** to confirm the changes.

   You can check that the container and its settings have changed using the [management console](https://console.yandex.cloud) or this [CLI](../../cli/quickstart.md) command:

   ```bash
   yc serverless container revision get <container_revision_ID>
   ```

- API {#api}

    To configure metadata service parameters for a container, use the [deployRevision](../containers/api-ref/Container/deployRevision.md) REST API method for the [Container](../containers/api-ref/Container/index.md) resource or the [ContainerService/DeployRevision](../containers/api-ref/grpc/Container/deployRevision.md) gRPC API call.

{% endlist %}