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"
]
}
}
}
}