全部產品
Search
文件中心

:ALIYUN::CMS::MonitoringAgentProcess

更新時間:Jul 27, 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"
        ]
      }
    }
  }
}