You need to enable JavaScript to run this app.
Container Registry

Container Registry

Copy page
Download PDF
Terraform
Creating Standard Edition instances
Copy page
Download PDF
Creating Standard Edition instances
This topic describes how to use Terraform to create a CR Standard Edition instance.​
Prerequisites​
You have completed the preparations for using Terraform in CR. For operation details, see Preparations.​
Procedure​
  1. Log in to the terminal where Terraform is installed.​
  1. Create a folder and a configuration file named main.tf in it.​
  • ​
    variable "common" {​
    type = object({​
    registry = string​
    region = string​
    })​
    default = {​
    # The name of the instance ​
    registry = "{your_instance_name}" ​
    # The region of the instance ​
    region = "cn-guangzhou" ​
    }​
    }​
    ​
    provider "volcengine" {​
    # The AK of your Volcano Engine root user ​
    access_key = "AKLT****" ​
    # The SK of your Volcano Engine account ​
    secret_key = "WTJG****" ​
    region = var.common.region​
    }​
    ​
    resource "volcengine_cr_registry" "label" {​
    name = var.common.registry​
    delete_immediately=false​
    # The password for the instance ​
    password = "{your_password}"​
    }​
    ​
    output "create_registry" {​
    value = volcengine_cr_registry.label​
    }​
    ​
  1. Initialize the Terraform environment.​
  • ​
    terraform init​
    ​
  1. Perform resource planning.​
  • ​
    terraform plan​
    ​
  1. Create an instance and set the instance password.​
warning​
You need to run this command twice: once to create the instance and to set the password.​
  • ​
    terraform apply -auto-approve​
    ​
Results​
After execution is complete, log in to the console to view the created instance.​
Last updated: 2026.10.19 15:46:48