terraform error - Unknown Filter Key: MSRC_SEVERITY

Viewed 110

Error message


    aws_ssm_patch_baseline.baseline: Modifying... [id=pb-041e9a4a9c8723c10]
    ╷
    │ Error: error updating SSM Patch Baseline (pb-041e9a4a9c8723c10): ValidationException: Unknown Filter Key: MSRC_SEVERITY
    │       status code: 400, request id: b55aa4df-b782-4e40-a3a7-5637ac903bdd
    │
    │   with aws_ssm_patch_baseline.baseline,
    │   on ssm.tf line 1, in resource "aws_ssm_patch_baseline" "baseline":
    │    1: resource "aws_ssm_patch_baseline" "baseline" {```



Terraform file content


    patch_filter {
          key    = "MSRC_SEVERITY"
          values = var.patch_severity
        }

Operating system for patch baseline is AMAZON_LINUX

For console, similar choice is available for selection in drop down field enter image description here

1 Answers

Different operating systems support different filter properties. Unfortunately AWS doesn't seem to tell you exactly which operating systems support which properties but the API docs list the valid values of properties and then you can run the following command to check whether they are valid for that operating system and what options are available:

$ aws ssm describe-patch-properties --operating-system AMAZON_LINUX --property MSRC_SEVERITY

An error occurred (ValidationException) when calling the DescribePatchProperties operation: Property MSRC_SEVERITY is not supported for operating system AMAZON_LINUX

$ aws ssm describe-patch-properties --operating-system AMAZON_LINUX --property SEVERITY
{
    "Properties": [
        {
            "Name": "Critical"
        },
        {
            "Name": "Important"
        },
        {
            "Name": "Low"
        },
        {
            "Name": "Medium"
        }
    ]
}

For reference, MSRC is the Microsoft Security Response Center so it makes sense that this only applies to Windows systems.

Related