全部产品
Search
文档中心

资源编排:ALIYUN::CMS::MonitoringAgentProcess

更新时间:Jul 26, 2024

ALIYUN::CMS::MonitoringAgentProcess类型用于创建进程监控。

语法

{
  "Type": "ALIYUN::CMS::MonitoringAgentProcess",
  "Properties": {
    "ProcessName": String,
    "InstanceId": String,
    "ProcessUser": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

InstanceId

String

实例ID。

ProcessName

String

进程名称。

ProcessUser

String

执行进程的用户。

返回值

Fn::GetAtt

Id:进程ID。

示例

YAML

ROSTemplateFormatVersion: '2015-09-01'
Description: Test CMS MonitoringAgentProcess
Parameters:
  InstanceId:
    Type: String
    Description: The ID of the instance.
    Default: i-***
  ProcessName:
    Type: String
    Description: The name of the process.
    Default: mytest
  ProcessUser:
    Type: String
    Default: root
Resources:
  MonitoringAgentProcess:
    Type: ALIYUN::CMS::MonitoringAgentProcess
    Properties:
      ProcessName:
        Ref: ProcessName
      InstanceId:
        Ref: ECS
      ProcessUser:
        Ref: ProcessUser
Outputs:
  Id:
    Value:
      Fn::GetAtt:
        - MonitoringAgentProcess
        - Id

JSON

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Test CMS MonitoringAgentProcess",
  "Parameters": {
    "InstanceId": {
      "Type": "String",
      "Description": "The ID of the instance.",
      "Default": "i-***"
    },
    "ProcessName": {
      "Type": "String",
      "Description": "The name of the process.",
      "Default": "mytest"
    },
    "ProcessUser": {
      "Type": "String",
      "Default": "root"
    }
  },
  "Resources": {
    "MonitoringAgentProcess": {
      "Type": "ALIYUN::CMS::MonitoringAgentProcess",
      "Properties": {
        "ProcessName": {
          "Ref": "ProcessName"
        },
        "InstanceId": {
          "Ref": "ECS"
        },
        "ProcessUser": {
          "Ref": "ProcessUser"
        }
      }
    }
  },
  "Outputs": {
    "Id": {
      "Value": {
        "Fn::GetAtt": [
          "MonitoringAgentProcess",
          "Id"
        ]
      }
    }
  }
}