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

语法

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

属性

属性名称 类型 必须 允许更新 描述 约束
ProcessName String 进程名称
InstanceId String 实例ID
ProcessUser String 执行进程的用户

返回值

Fn::GetAtt

Id:进程ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ProcessName": {
      "Type": "String",
      "Description": "The name of the process."
    },
    "InstanceId": {
      "Type": "String",
      "Description": "The ID of the instance."
    },
    "ProcessUser": {
      "Type": "String",
      "Description": "The user who launched the process."
    }
  },
  "Resources": {
    "MonitoringAgentProcess": {
      "Type": "ALIYUN::CMS::MonitoringAgentProcess",
      "Properties": {
        "ProcessName": {
          "Ref": "ProcessName"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "ProcessUser": {
          "Ref": "ProcessUser"
        }
      }
    }
  },
  "Outputs": {
    "Id": {
      "Description": "The process ID.",
      "Value": {
        "Fn::GetAtt": [
          "MonitoringAgentProcess",
          "Id"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ProcessName:
    Type: String
    Description: The name of the process.
  InstanceId:
    Type: String
    Description: The ID of the instance.
  ProcessUser:
    Type: String
    Description: The user who launched the process.
Resources:
  MonitoringAgentProcess:
    Type: 'ALIYUN::CMS::MonitoringAgentProcess'
    Properties:
      ProcessName:
        Ref: ProcessName
      InstanceId:
        Ref: InstanceId
      ProcessUser:
        Ref: ProcessUser
Outputs:
  Id:
    Description: The process ID.
    Value:
      'Fn::GetAtt':
        - MonitoringAgentProcess
        - Id