All Products
Search
Document Center

Service Catalog:Manage products

Last Updated:Apr 10, 2024

This topic describes how to create, modify, and delete an Elastic Compute Service (ECS) product.

Prerequisites

You are granted the administrative rights of Service Catalog. For more information, see Grant permissions to the administrator.

Background information

A product is a concept specific to Service Catalog. A product can be a single cloud resource or a group of cloud resources. You can define compliant products and manage multiple versions of the products.

You can group resources by product to manage products throughout lifecycles in a centralized manner. For example, multiple employees in an enterprise need to manage ECS instances throughout the instance lifecycles. In this case, you can define ECS-related resources when you create a product, add the product to a product portfolio, and then grant permissions to the employees. This way, the resources are managed in a centralized manner, and management costs are reduced. After a product is created, you can create versions for the product based on your business requirements, and specify recommendations for each version. This facilitates product management based on the versions.

You can create a product by using a Terraform or Resource Orchestration Service (ROS) template. Custom and sample templates are supported. For more information about Terraform and ROS templates, see Terraform Language Documentation and Template structure.

Create a product

Create a product by using a sample template

  1. Log on to the Service Catalog console as the administrator.
  2. In the left-side navigation pane, choose Administrator > Product management.
  3. On the Product management page, click Create product.
  4. On the Create product page, configure the parameters.

    1. In the Product details section, configure the Name, Provider, and Product description parameters.

    2. Select a template type.

      You can select ROS or Terraform to create the product by using an ROS template or a Terraform template.

    3. In the Version details section, configure the parameters for the version of the product that you want to create.

      1. Enter a version name in the Version name field.

      2. Enter a version description in the Product version description field.

      3. Select a template type.

        You can select Custom or Getting Started Example to create the product by using a custom or sample template. In this example, Getting Started Example is selected.

      4. Select a template provided by Service Catalog based on your business requirements.

      5. View the template content. You can modify the template content.

        • Terraform template: You can view the files in the template and the detailed file content on the File List View tab. You can configure the parameters in the template on the Parameter view tab, such as the basic attributes, verification rules, and options of each parameter.

        • ROS template: You can view the template content in JSON and YAML formats.

  5. Click Parameter preview to check whether the parameter settings meet your business requirements.

  6. Click Confirm.

Create a product by using a custom template

You can create a product by using a custom ROS or Terraform template. In this example, a Terraform template named create_ecs is written and uploaded to the Service Catalog console.

Template content

The template contains the main.tf file and the variables.tf file. In the two files, the resource field defines the resources that you want to create. In this example, the resources are a virtual private cloud (VPC), a vSwitch, a security group, and an ECS instance. The output field defines the output content that end users can view after a product instance is created. In this example, the content includes the VPC ID, vSwitch ID, and ECS instance ID. The variable field defines the available instance types of the ECS instance to be created by using AllowedValues.

Note
  • In the main.tf file, instance_type = var.instance_type specifies that the instance types in the variables.tf file are used to create ECS instances.

  • In the main.tf file, the zone is cn-beijing-h. An end user who has the permissions to launch the product must deploy the product instance in the China (Beijing) region. Otherwise, the ECS instance fails to be created.

  • main.tf

    
    resource "alicloud_vpc" "vpc" {
      name       = "tf_test_foo"
      cidr_block = "172.16.0.0/12"
    }
    
    resource "alicloud_vswitch" "vsw" {
      vpc_id            = alicloud_vpc.vpc.id
      cidr_block        = "172.16.0.0/21"
      availability_zone = "cn-beijing-h"
    }
    
    resource "alicloud_security_group" "default" {
      name = "default"
      vpc_id = alicloud_vpc.vpc.id
    }
    
    resource "alicloud_instance" "instance" {
      # cn-beijing
      availability_zone = "cn-beijing-h"
      security_groups = alicloud_security_group.default.*.id
      # series III
      instance_type        = var.instance_type
      system_disk_category = "cloud_efficiency"
      image_id             = "ubuntu_18_04_64_20G_alibase_20190624.vhd"
      instance_name        = "test_foo"
      vswitch_id = alicloud_vswitch.vsw.id
      internet_max_bandwidth_out = 10
    }
    
    resource "alicloud_security_group_rule" "allow_all_tcp" {
      type              = "ingress"
      ip_protocol       = "tcp"
      nic_type          = "intranet"
      policy            = "accept"
      port_range        = "1/65535"
      priority          = 1
      security_group_id = alicloud_security_group.default.id
      cidr_ip           = "0.0.0.0/0"
    }
    
    output "vpc_id" {
      value       = alicloud_vpc.vpc.id
      description = "The ID of the VPC."
    }
    
    output "vswitch_id" {
      value       = alicloud_vswitch.vsw.id
      description = "The ID of the switch."
    }
    
    output "instance_id" {
      value       = alicloud_instance.instance.id
      description = "The ECS instance ID."
    }
  • variables.tf

    variable "instance_type" {
      type = string
      description = <<EOT
      {
        "AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
        "AllowedValues": ["ecs.s6-c1m1.small", "ecs.s6-c1m2.small", "ecs.s6-c1m2.large", "ecs.s6-c1m2.xlarge", "ecs.s6-c1m2.2xlarge"],
        "Label": "ECS instance type"
      }
      EOT
    }

Procedure

  1. Log on to the Service Catalog console as the administrator.
  2. In the left-side navigation pane, choose Administrator > Product management.
  3. On the Product management page, click Create product.
  4. Select Terraform as the template type.

  5. On the Create product page, configure the parameters.

    1. In the Product details section, configure the Name, Provider, and Product description parameters.

    2. In the Version details section, configure the parameters for the version of the product that you want to create.

      1. Enter a version name in the Version name field.

      2. Enter a version description in the Product version description field.

      3. Select a template type.

        In this example, Custom is selected to use a custom template to create the product.

      4. Click Upload Folder to upload the template.

        In this example, the create_ecs template is uploaded.

      5. View the template content. You can modify the template content.

        You can view the files in the template and the detailed file content on the File List View tab. You can configure the parameters in the template on the Parameter view tab, such as the basic attributes, verification rules, and options of each parameter.

  6. Click Parameter preview to check whether the parameter settings meet your business requirements.

  7. Click Confirm.

Modify the basic information of a product

  1. In the left-side navigation pane, choose Administrator > Product management.
  2. On the Product management page, find the product that you want to modify and click Edit in the Operation column.

  3. In the Modify product information dialog box, modify the Name, Provider, and Description parameters.

  4. Click Confirm.

Delete a product

Warning

Before you delete a product, make sure that the product is no longer in use. If you delete a product that is in use, end users cannot manage the resources of the product. If the product that you want to delete is added to a product portfolio, the product is also removed from the product portfolio when you delete the product. Proceed with caution.

  1. In the left-side navigation pane, choose Administrator > Product management.
  2. On the Product management page, find the product that you want to delete and click Delete in the Operation column.

  3. In the Delete product message, check and confirm the information, and then click OK.