1

While running AWSFIS-Run-CPU-Stress i am getting below error:

Unable to start action, due to a platform mismatch between the specified document and the targeted instances. I am trying this in Windows EC2 instance

My Experiment script look like this(removed confidential server info):

{
    "description": "Test CPU stress predefined SSM document",
    "targets": {
        "testInstance": {
            "resourceType": "aws:ec2:instance",
            "resourceArns": [
                "arn:aws:ec2:region:123456789012:instance/instance_id"
            ],
            "selectionMode": "ALL"
        }
    },
    "actions": {
        "runCpuStress": {
            "actionId": "aws:ssm:send-command",
            "parameters": {
                "documentArn": "arn:aws:ssm:region::document/AWSFIS-Run-CPU-Stress",
                "documentParameters": "{\"DurationSeconds\":\"120\"}",
                "duration": "PT5M"
            },
            "targets": {
                "Instances": "testInstance"
            }
        }
    },
    "stopConditions": [
        {
            "source": "aws:cloudwatch:alarm",
            "value": "arn:aws:cloudwatch:region:123456789012:alarm:awsec2-instance_id-GreaterThanOrEqualToThreshold-CPUUtilization"
        }
    ],
    "roleArn": "arn:aws:iam::123456789012:role/AllowFISSSMActions",
    "tags": {}
}
Robert
  • 33,429
  • 8
  • 90
  • 94
Sameer
  • 35
  • 1
  • 11
  • "Stop server" experiment worked for the same server. But the CPU or memory stress experiment not working. Is it because my server is Windows server? – Sameer Feb 16 '23 at 11:17

1 Answers1

0

As of April 2023, AWS FIS pre-configured scripts do not currently support Windows instances. From the docs [1]:

Requirements

The pre-configured SSM documents provided by AWS FIS are supported only on Amazon Linux and Ubuntu. On other Linux systems and Windows, you can use the aws:ssm:send-command action to run your own SSM document.

The suggestion is to come up with your own SSM documents crafted for Windows shell (I guess with PowerShell). You would include there something like [2] and run it via FIS aws:ssm:send-command action, providing your crafted SSM document.

[1] https://docs.aws.amazon.com/fis/latest/userguide/actions-ssm-agent.html

[2] https://superuser.com/questions/396501/how-can-i-produce-high-cpu-load-on-windows/396531#396531

Robert
  • 33,429
  • 8
  • 90
  • 94