Servicios de Amazon ECS
En el siguiente ejemplo se muestra una configuración de componentes en formato JSON para un servicio de Amazon ECS.
{ "alarmMetrics":[ { "alarmMetricName":"CPUUtilization", "monitor":true }, { "alarmMetricName":"MemoryUtilization", "monitor":true }, { "alarmMetricName":"CpuUtilized", "monitor":true }, { "alarmMetricName":"MemoryUtilized", "monitor":true }, { "alarmMetricName":"NetworkRxBytes", "monitor":true }, { "alarmMetricName":"NetworkTxBytes", "monitor":true }, { "alarmMetricName":"RunningTaskCount", "monitor":true }, { "alarmMetricName":"PendingTaskCount", "monitor":true }, { "alarmMetricName":"StorageReadBytes", "monitor":true }, { "alarmMetricName":"StorageWriteBytes", "monitor":true } ], "logs":[ { "logGroupName":"/ecs/my-task-definition", "logType":"APPLICATION", "monitor":true } ], "subComponents":[ { "subComponentType":"AWS::ElasticLoadBalancing::LoadBalancer", "alarmMetrics":[ { "alarmMetricName":"HTTPCode_Backend_4XX", "monitor":true }, { "alarmMetricName":"HTTPCode_Backend_5XX", "monitor":true }, { "alarmMetricName":"Latency", "monitor":true }, { "alarmMetricName":"SurgeQueueLength", "monitor":true }, { "alarmMetricName":"UnHealthyHostCount", "monitor":true } ] }, { "subComponentType":"AWS::ElasticLoadBalancingV2::LoadBalancer", "alarmMetrics":[ { "alarmMetricName":"HTTPCode_Target_4XX_Count", "monitor":true }, { "alarmMetricName":"HTTPCode_Target_5XX_Count", "monitor":true }, { "alarmMetricName":"TargetResponseTime", "monitor":true }, { "alarmMetricName":"UnHealthyHostCount", "monitor":true } ] }, { "subComponentType":"AWS::EC2::Instance", "alarmMetrics":[ { "alarmMetricName":"CPUUtilization", "monitor":true }, { "alarmMetricName":"StatusCheckFailed", "monitor":true }, { "alarmMetricName":"disk_used_percent", "monitor":true }, { "alarmMetricName":"mem_used_percent", "monitor":true } ], "logs":[ { "logGroupName":"my_log_group", "logPath":"/mylog/path", "logType":"APPLICATION", "monitor":true } ], "processes" : [ { "processName" : "my_process", "alarmMetrics" : [ { "alarmMetricName" : "procstat cpu_usage", "monitor" : true }, { "alarmMetricName" : "procstat memory_rss", "monitor" : true } ] } ], "windowsEvents":[ { "logGroupName":"my_log_group_2", "eventName":"Application", "eventLevels":[ "ERROR", "WARNING", "CRITICAL" ], "monitor":true } ] }, { "subComponentType":"AWS::EC2::Volume", "alarmMetrics":[ { "alarmMetricName":"VolumeQueueLength", "monitor":"true" }, { "alarmMetricName":"VolumeThroughputPercentage", "monitor":"true" }, { "alarmMetricName":"BurstBalance", "monitor":"true" } ] } ] }
nota
-
La sección
subComponents
deAWS::EC2::Instance
yAWS::EC2::Volume
solo aplica a Amazon ECS que se ejecute en el tipo de lanzamiento de EC2. -
La sección
windowsEvents
deAWS::EC2::Instance
ensubComponents
solo aplica a Windows que se ejecute en instancias de Amazon EC2.