Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML Services
    • Business tools
  • 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
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud CDN
  • Getting started
    • All guides
      • Creating a resource
      • Copying a configuration from one resource to another
      • Updating basic settings of a resource
      • Getting information about a resource
      • Configuring resource caching
      • Configuring log export
      • Prefetching files to CDN servers
      • Purging resource cache
      • Configuring request and response headers
      • Configuring CORS for responses to clients
      • Configuring HTTP methods
      • Enabling file compression
      • Enabling file segmentation
      • Enabling origin shielding
      • Configuring request redirection
      • Setting up access via a secure token
      • Managing additional resource settings
      • Disabling a resource
      • Managing resource labels
      • Deleting a resource
      • Viewing resource statistics
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics for the EdgeCDN provider
  • Monitoring metrics for the Yandex Cloud CDN provider
  • Audit Trails events
  • Release notes
  • Troubleshooting
  1. Step-by-step guides
  2. Resources
  3. Deleting a resource

Deleting a resource

Written by
Yandex Cloud
Updated at July 14, 2025
Management console
CLI
Terraform
API
  1. In the management console, select the folder where your resource is located.
  2. Select Cloud CDN.
  3. Click the resource name.
  4. In the top-right corner, click Delete and then click Delete in the window that opens.

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

By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.

  1. View the description of the CLI command to delete a resource:

    yc cdn resource delete --help
    
  2. Get a list of all resources in the default folder:

    yc cdn resource list --format yaml
    

    Result:

    id: s0me1dkfjq********
    folder_id: s0mef01der7p********
    cname: testexample.com
    ...
    ssl_certificate:
      type: DONT_USE
      status: READY
    
  3. Delete the resource:

    yc cdn resource delete <resource_ID>
    

    For more information about the yc cdn resource delete command, see the CLI reference.

  4. Make sure that the delete operation was successful. To do this, view the folder's resource list again:

    yc cdn resource list
    

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

To delete a CDN resource created with Terraform:

  1. Open the Terraform configuration file and delete the resource description fragment.

    An example of a CDN resource description in the Terraform configuration
    resource "yandex_cdn_resource" "my_resource" {
        cname               = "cdn1.yandex-example.ru"
        active              = false
        origin_protocol     = "https"
        secondary_hostnames = ["cdn-example-1.yandex.ru", "cdn-example-2.yandex.ru"]
        origin_group_id     = yandex_cdn_origin_group.my_group.id
        ...
        options {
          edge_cache_settings = "345600"
          ignore_cookie       = true
          ...
        }
    }
    
  2. In the command line, go to the directory with the Terraform configuration file.

  3. Check the configuration using this command:

    terraform validate
    

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

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

    terraform plan
    

    You will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.

  5. Apply the changes:

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

    You can check whether the CDN resource has been deleted using the management console or this CLI command:

    yc cdn resource list
    

To delete a resource, use the delete REST API method for the Resource resource or the ResourceService/Delete gRPC API call.

Was the article helpful?

Previous
Managing resource labels
Next
Viewing resource statistics
© 2025 Direct Cursus Technology L.L.C.