2

I'm using latest Windows 2016 AMI from AWS - Windows_Server-2016-English-Full-Base-2017.01.11

IAM Role assigned to instance contains AdministratorAccess policy for testing purposes.

I've added AWS.EC2.Windows.CloudWatch.json file to C:\Program Files\Amazon\SSM\Plugins\awsCloudWatch directory.

Config file content:

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

}

And it doesn't work, both CloudWatch Metrics and Logs are unavailable.

Any ideas how it can be fixed?

Thanks in advance!

kagarlickij
  • 7,327
  • 10
  • 36
  • 71
  • Did you restart the EC2Config service after modifying the .json file? – Mahdi Feb 07 '17 at 12:59
  • Sure, I tried to restart service and restart instance as well. And I tried this on a few instances. – kagarlickij Feb 09 '17 at 13:17
  • Check this out: http://stackoverflow.com/questions/41330555/monitoring-memory-usage-in-aws-cloudwatch-for-windows-instance/41343234#41343234 – Mahdi Feb 09 '17 at 13:34
  • I am having the same problem. As far as i can tell in Windows 2016, the ec2config service has been replaced by ec2Launch, but in Windows 2016, this is controlled by SSMAgent which is the thing that needs to be restarted. – Philip Nelson Feb 18 '17 at 23:01

0 Answers0