Integration with ROS

更新时间:
复制 MD 格式

Resource Orchestration Service (ROS) can automatically create and configure all the resources defined in templates to implement automated deployment and O&M. You can use ROS to call the API operations of CloudOps Orchestration Service (OOS), for example, to automatically create a common parameter.

Supported resources

ROS is a service provided by Alibaba Cloud that simplifies cloud resource management. You define the required resources, such as Elastic Compute Service (ECS) and ApsaraDB RDS instances, in a template, and ROS automatically creates and configures them. For more information, see What is Resource Orchestration Service

The following table lists the OOS resources that can be orchestrated by using ROS.

Resource type

Reference

Description

Resources

ALIYUN::OOS::DefaultPatchBaseline

Registers a default patch baseline.

ALIYUN::OOS::Execution

Starts an execution.

ALIYUN::OOS::Template

Creates a template.

ALIYUN::OOS::Parameter

Creates a common parameter.

ALIYUN::OOS::PatchBaseline

Creates a patch baseline.

ALIYUN::OOS::SecretParameter

Creates an encrypted parameter.

ALIYUN::OOS::StateConfiguration

Creates a desired-state configuration.

Data sources

DATASOURCE::OOS::PatchBaseline

Queries a patch baseline.

DATASOURCE::OOS::PatchBaselines

Queries a list of patch baselines.

DATASOURCE::OOS::SecretParameters

Queries a list of encrypted parameters.

Permissions

An Alibaba Cloud account has permissions on all API operations but may pose security risks. We recommend that you use a Resource Access Management (RAM) user for API calls and routine O&M. Before you use a RAM user, grant the required permissions. For more information, see Use RAM for access control.

Procedure

  1. Log on to the ROS console. In the top navigation bar, select a region based on your business requirements.

  2. In the left-side navigation pane, choose Deployment > Stacks. On the Stacks page, choose Create Stack > Use ROS.

    • Specify Template: Select Select an Existing Template.

    • Template Import Method: Select Enter Template Content.

  3. In the Template Content section, click the ROS tab and enter code in the JSON or YAML format.

    For more information about the syntax and parameters, see ALIYUN::OOS::Parameter. The following sample code creates a common parameter.

    YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      Parameter:
        Type: ALIYUN::OOS::Parameter
        Properties:
          Type: String
          Value: echo hello world
          Description: Prefix for Interruption Handler parameters
          Name:
            Fn::Join:
              - ''
              - - /ecs-test-handler/run_commands/test-SampleWebAppAutoScalingGroup-
                - Ref: ALIYUN::StackId
    Outputs:
      Value:
        Description: The Value of the parameter.
        Value:
          Fn::GetAtt:
            - Parameter
            - Value
      Name:
        Description: The Name of the parameter.
        Value:
          Fn::GetAtt:
            - Parameter
            - Name

    JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "Parameter": {
          "Type": "ALIYUN::OOS::Parameter",
          "Properties": {
            "Type": "String",
            "Value": "echo hello world",
            "Description": "Prefix for Interruption Handler parameters",
            "Name": {
              "Fn::Join": [
                "",
                [
                  "/ecs-test-handler/run_commands/test-SampleWebAppAutoScalingGroup-",
                  {
                    "Ref": "ALIYUN::StackId"
                  }
                ]
              ]
            }
          }
        }
      },
      "Outputs": {
        "Value": {
          "Description": "The Value of the parameter.",
          "Value": {
            "Fn::GetAtt": [
              "Parameter",
              "Value"
            ]
          }
        },
        "Name": {
          "Description": "The Name of the parameter.",
          "Value": {
            "Fn::GetAtt": [
              "Parameter",
              "Name"
            ]
          }
        }
      }
    }
  4. Click Next. In the Configure Parameters step, select Yes for the Rollback on Failure parameter.

  5. Click Create to create the stack.

  6. View the result.

    image

  7. Log on to the OOS console. In the left-side navigation pane, click Parameter Store.

  8. In the top navigation bar, select the region in which you created the stack.

  9. On the Common Parameters tab of the Parameter Store page, check whether the parameter is created as expected.

    image