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
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Serverless Containers
  • Comparison with other Yandex Cloud services
    • All guides
    • Getting an IAM token for a service account using a container
      • Making a revision active
      • Changing the container operation mode
      • Adding environment variables
      • Specifying a cloud network
      • Transferring Yandex Lockbox secrets
      • Viewing monitoring charts
      • Migration to the ru-central1-d availability zone
      • Deleting a container
    • Viewing operations with service resources
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Managing a container
  3. Deleting a container

Deleting a container

Written by
Yandex Cloud
Updated at April 22, 2025
Management console
CLI
Terraform
API
  1. In the management console, select the folder with your container.
  2. Select Serverless Containers.
  3. In the required container row, click .
  4. In the menu that opens, click Delete.
  5. In the window that opens, click Delete.

To delete a container, run this command:

yc serverless container delete --name <container_name>

Result:

done (2s)

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 delete a container created with Terraform:

  1. Open the Terraform configuration file and delete the section with the container description.

    Example container description in the Terraform configuration:

    ...
    resource "yandex_serverless_container" "test-container" {
      name               = "my-container"
      memory             = 256
      service_account_id = "ajecvjv1lv01********"
      image {
          url = "cr.yandex/yc/test-image:v1"
      }
    }
    ...
    

    For more information about the yandex_serverless_container resource parameters in Terraform, see the provider documentation.

  2. Check the configuration using this command:

    terraform validate
    

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

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

    terraform plan
    

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

  4. Apply the configuration changes:

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

You can check the deletion of the container using the management console or this CLI command:

yc serverless container list

To delete a container, use the delete REST API method for the Container resource or the ContainerService/Delete gRPC API call.

Was the article helpful?

Previous
Migration to the ru-central1-d availability zone
Next
Getting a list of triggers
Yandex project
© 2025 Yandex.Cloud LLC