Custom stack creation page

更新时间:
复制 MD 格式

A custom URL can open a pre-configured Create Stack page in the Resource Orchestration Service (ROS) console, launching a stack creation process with predefined settings and reducing manual input.

Build a custom URL

The following example builds a custom URL that configures the Create Stack page with the name prefix MyStack, a specific template, a RAM role named CustomRole, and the page title Create RAM Role.

  • Example URL

    Note

    Visit this URL to view the result.

    # The line break is for readability only. Do not add a line break in the actual URL.
    https://ros.console.aliyun.com/cn-hangzhou/stacks/create?
    step=2&exampleTemplateUrl=http://ros-template.cn-hangzhou.oss.aliyun-inc.com/ECS_Ram_Role.json&stackNamePrefix=MyStack&parameters={"RoleName":"CustomRole"}&isSimplified=true&productNavBar=disabled&pageTitle={"zh-cn": "创建RAM角色", "en": "Create RAM Role"}
  • Opening this URL in a browser sends a GET request to the ROS console, which uses the query parameters to render a custom stack creation page.

    The page opens to the Configure Parameters step. The Stack Name field defaults to a value like MyStack_2024-0xxx, the RAM Role Name is set to CustomRole, and the YAML editor contains the - oss:Get* and - oss:List* policies.

Anatomy of the custom URL

The example URL has two parts separated by a question mark (?).

  • The base URL, which is the access path.

    https://ros.console.aliyun.com/cn-hangzhou/stacks/create
    • This path points to the Create Stack page in the ROS console.

    • The cn-hangzhou component specifies that the stack is created in the China (Hangzhou) region. You can replace this with a different region ID. For more information, see ROS regions.

  • The query parameters.

    # The line break is for readability only. Do not add a line break in the actual URL.
    step=2&
    exampleTemplateUrl=http://ros-template.cn-hangzhou.oss.aliyun-inc.com/ECS_Ram_Role.json&
    stackNamePrefix=MyStack&
    parameters={"RoleName":"CustomRole"}&
    isSimplified=true&
    productNavBar=disabled&
    pageTitle={"zh-cn": "创建RAM角色", "en": "Create RAM Role"}

    Query parameters are key-value pairs separated by ampersands (&). Each pair configures an option that defines the initial state and appearance of the Create Stack page. The following table describes the parameters in the example. For a complete list of supported parameters, see Supported custom parameters.

    Key-value pair

    Parameter

    Value

    Description

    step=2

    step

    2

    Jumps directly to the Configure Parameters step.

    exampleTemplateUrl=http://ros-template.cn-hangzhou.oss.aliyun-inc.com/ECS_Ram_Role.json

    exampleTemplateUrl

    http://ros-template.cn-hangzhou.oss.aliyun-inc.com/ECS_Ram_Role.json

    Loads the template from the specified URL: RAM role for ECS instance.

    stackNamePrefix=MyStack

    stackNamePrefix

    MyStack

    Sets the stack name prefix to MyStack.

    parameters={"RoleName":"CustomRole"}

    parameters

    {"RoleName":"CustomRole"}

    Sets the template parameter RoleName to CustomRole.

    isSimplified=true

    isSimplified

    true

    Uses the simplified creation page.

    Note

    When the isSimplified parameter is set to true, the step parameter values 2 and 3 have no effect.

    productNavBar=disabled

    productNavBar

    disabled

    Hides the left-side product navigation bar.

    pageTitle={"zh-cn": "创建RAM角色", "en": "Create RAM Role"}

    pageTitle

    {"zh-cn": "Create RAM Role", "en": "Create RAM Role"}

    Sets the page title to Create RAM Role.

Supported custom parameters

Parameter

Type

Description

Details

step

number

The default step in the stack creation wizard.

Valid values:

  • 0: Select Template

  • 1: Configure Parameters

  • 2: Compliance Precheck

  • 3: Check and Confirm

Note

When the isSimplified parameter is set to true, the values 2 and 3 for this parameter have no effect.

stackName

string

The stack name.

Example: MyStack

Note

You can specify either the stackName or stackNamePrefix parameter, but not both.

stackNamePrefix

string

The prefix for the stack name. The rest of the name is randomly generated.

Example: MyPrefix

Note

You can specify either the stackNamePrefix or stackName parameter, but not both.

stackId

string

The ID of the stack to clone.

Example: 91062917-1467-4f66-ab7a-f176c3ae****

Note

You can specify only one of the following parameters: stackId, privateTemplateId, exampleTemplateUrl, or templateUrl.

pageTitle

map

The title of the custom page.

A JSON-formatted string that supports internationalization.

Example value: {"zh-cn":"创建服务","en":"Create Service"}.

productNavBar

string

Hides the left-side navigation menu when set to disabled.

Valid values:

  • Empty (default): The navigation menu is displayed.

  • disabled: The navigation menu is hidden.

disableNavigation

boolean

Whether to hide the breadcrumb navigation at the top of the page.

Valid values:

  • true: The breadcrumb navigation is hidden.

  • false (default): The breadcrumb navigation is displayed.

hideTitle

boolean

Whether to hide the page title.

Valid values:

  • true: The page title is hidden.

  • false (default): The page title is displayed.

hideStepRow

boolean

Whether to hide the wizard at the top of the page.

Valid values:

  • true: The wizard is hidden.

  • false (default): The wizard is displayed.

timeoutMins

number

The timeout period for the stack operation.

Unit: minutes

Default: 60

Value range: 10 to 1440

Example: 60

disableRollback

boolean

Whether to roll back the stack if the operation fails.

Valid values:

  • false: Rolls back the stack on failure.

  • true (default): Does not roll back the stack on failure.

showTag

boolean

Whether to show tag settings.

Valid values:

  • true: The tag settings are displayed.

  • false: The tag settings are not displayed.

privateTemplateId

string

The ID of a template in My Templates.

Example: 5ecd1e10-b0e9-4389-a565-e4c15efc****

Note

You can specify only one of the following parameters: privateTemplateId, exampleTemplateUrl, templateUrl, or stackId.

privateTemplateVersion

string

The version of a template in My Templates.

Example: v1

This parameter is valid only when you specify the privateTemplateId parameter.

exampleTemplateUrl

string

The URL of a sample template.

Example: oss://ros-template/demo

Note

You can specify only one of the following parameters: exampleTemplateUrl, privateTemplateId, templateUrl, or stackId.

templateType

string

How to provide the template.

Valid values:

  • url: Use URL.

  • text: Enter Template.

  • my_tpl: My Templates.

  • share_tpl: Shared Templates.

templateUrl

string

The URL of the template. ROS parses the template content from this URL.

The URL must point to a template on an HTTP or HTTPS web server, or in an Alibaba Cloud OSS bucket (for example, oss://ros/stack-policy/demo or oss://ros/stack-policy/demo?RegionId=cn-hangzhou). The template file can be up to 524,288 bytes in size. If an OSS region is not specified, ROS uses the stack's region by default.

Example: oss://ros-template/demo

Note

You can specify only one of the following parameters: templateUrl, privateTemplateId, exampleTemplateUrl, or stackId.

hideTemplateSelector

boolean

Whether to hide the options for providing the template.

Valid values:

  • true: The options are hidden.

  • false (default): The options are displayed.

parameters

string

The template parameters.

The value is a JSON-formatted string.

Example: {"ZoneId":"cn-beijing-c"}

createType

string

The creation type.

Valid values:

  • Empty: Creates a stack.

  • import: Imports resources.

isSimplified

boolean

Whether to use the simplified creation page.

Valid values:

  • true: Uses the simplified creation page.

  • false (default): Uses the standard creation page.

tags

map

The tags for the stack.

The value is a JSON-formatted string.

Example: {"key1": "value1", "key2": "value2"}

Note

This parameter has no effect if the showTag parameter is set to false.

immutableTags

map

Immutable tags that cannot be modified after the stack is created.

The value is a JSON-formatted string.

Example: {"key1": "value1", "key2": "value2"}

notificationURLs

string

The callback URLs for receiving stack event notifications.

The value is a list of strings in JSON format.

Example: ["url1", "url2"]

immutableNotificationURLs

string

Immutable callback URLs for stack event notifications that cannot be modified after the stack is created.

The value is a list of strings in JSON format.

Example: ["url1", "url2"]