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"
]
}
}
}
}
文档内容是否对您有帮助?