2

我正在使用来自 AWS 的最新 Windows 2016 AMI - Windows_Server-2016-English-Full-Base-2017.01.11

分配给实例的 IAM 角色包含用于测试目的的 AdministratorAccess 策略。

我已将AWS.EC2.Windows.CloudWatch.json文件添加到C:\Program Files\Amazon\SSM\Plugins\awsCloudWatch目录。

配置文件内容:

{
"schemaVersion": "1.2",
"description": "Example CloudWatch Logs tasks",
"runtimeConfig": {
    "aws:cloudWatch": {
        "settings": {
            "startType": "Enabled"
        },
        "properties": {
            "IsEnabled": true,
            "EngineConfiguration": {
                "PollInterval": "00:00:15",
                "Components": [
                    {
                        "Id": "ApplicationEventLog",
                        "FullName": "AWS.EC2.Windows.CloudWatch.EventLog.EventLogInputComponent,AWS.EC2.Windows.CloudWatch",
                        "Parameters": {
                            "LogName": "Application",
                            "Levels": "7"
                        }
                    },
                    {
                        "Id": "SecurityEventLog",
                        "FullName": "AWS.EC2.Windows.CloudWatch.EventLog.EventLogInputComponent,AWS.EC2.Windows.CloudWatch",
                        "Parameters": {
                        "LogName": "Security",
                        "Levels": "7"
                        }
                    },
                    {
                        "Id": "MemoryCounter",
                        "FullName": "AWS.EC2.Windows.CloudWatch.PerformanceCounterComponent.PerformanceCounterInputComponent,AWS.EC2.Windows.CloudWatch",
                        "Parameters": {
                            "CategoryName": "Memory",
                            "CounterName": "Available MBytes",
                            "InstanceName": "",
                            "MetricName": "Available Memory",
                            "Unit": "Megabytes",
                            "DimensionName": "instance_id",
                            "DimensionValue": "{instance_id}"
                        }
                    },
                    {
                        "Id": "CloudWatchLogs",
                        "FullName": "AWS.EC2.Windows.CloudWatch.CloudWatchLogsOutput,AWS.EC2.Windows.CloudWatch",
                        "Parameters": {
                            "AccessKey": "",
                            "SecretKey": "",
                            "Region": "eu-west-1",
                            "LogGroup": "test-2016",
                            "LogStream": "{instance_id}"
                        }
                    },
                    {
                        "Id": "CloudWatch",
                        "FullName": "AWS.EC2.Windows.CloudWatch.CloudWatch.CloudWatchOutputComponent,AWS.EC2.Windows.CloudWatch",
                        "Parameters": {
                            "AccessKey": "",
                            "SecretKey": "",
                            "Region": "eu-west-1",
                            "NameSpace": "Windows/Default"
                        }
                    }
                ],
                "Flows": {
                    "Flows": [
                        "(ApplicationEventLog, SecurityEventLog),CloudWatchLogs",
                        "(MemoryCounter),CloudWatch"
                    ]
                }
            }
        }
    }
}

}

而且它不起作用,CloudWatch 指标和日志都不可用。

有什么想法可以解决吗?

提前致谢!

4

0 回答 0