{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-compute-optimizer/json-schema/amazon-compute-optimizer-create-automation-rule-request-schema.json",
  "title": "CreateAutomationRuleRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-compute-optimizer-automation-rule-api-openapi.yml#/components/schemas/CreateAutomationRuleRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the automation rule."
    },
    "description": {
      "type": "string",
      "description": "A description of the automation rule."
    },
    "ruleType": {
      "type": "string",
      "enum": [
        "OrganizationRule",
        "AccountRule"
      ],
      "description": "The type of rule. Only the management account or a delegated administrator can set the ruleType to be OrganizationRule."
    },
    "organizationConfiguration": {
      "$ref": "#/$defs/OrganizationConfiguration"
    },
    "priority": {
      "type": "string",
      "description": "A string representation of a decimal number between 0 and 1 (having up to 30 digits after the decimal point) that determines the priority of the rule. When multiple rules match the same recommended action, Compute Optimizer assigns the action to the rule with the lowest priority value (highest priority), even if that rule is scheduled to run later than other matching rules."
    },
    "recommendedActionTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "SnapshotAndDeleteUnattachedEbsVolume",
          "UpgradeEbsVolumeType"
        ]
      },
      "description": "The types of recommended actions this rule will automate."
    },
    "criteria": {
      "$ref": "#/$defs/Criteria"
    },
    "schedule": {
      "$ref": "#/$defs/Schedule"
    },
    "status": {
      "type": "string",
      "enum": [
        "Active",
        "Inactive"
      ],
      "description": "The status of the rule"
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AcoAutomationTag"
      },
      "description": "The tags to associate with the rule."
    },
    "clientToken": {
      "type": "string",
      "description": "A unique identifier to ensure idempotency of the request."
    }
  },
  "required": [
    "name",
    "ruleType",
    "recommendedActionTypes",
    "schedule",
    "status"
  ],
  "$defs": {
    "AcoAutomationTag": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The tag key, which can be up to 128 characters long."
        },
        "value": {
          "type": "string",
          "description": "The tag value, which can be up to 256 characters long."
        }
      },
      "required": [
        "key",
        "value"
      ]
    },
    "Criteria": {
      "type": "object",
      "properties": {
        "region": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StringCriteriaCondition"
          },
          "description": "Filter criteria for Amazon Web Services regions where resources must be located."
        },
        "resourceArn": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StringCriteriaCondition"
          },
          "description": "Filter criteria for specific resource ARNs to include or exclude."
        },
        "ebsVolumeType": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StringCriteriaCondition"
          },
          "description": "Filter criteria for EBS volume types, such as gp2, gp3, io1, io2, st1, or sc1."
        },
        "ebsVolumeSizeInGib": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/IntegerCriteriaCondition"
          },
          "description": "Filter criteria for EBS volume sizes in gibibytes (GiB)."
        },
        "estimatedMonthlySavings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DoubleCriteriaCondition"
          },
          "description": "Filter criteria for estimated monthly cost savings from the recommended action."
        },
        "resourceTag": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ResourceTagsCriteriaCondition"
          },
          "description": "Filter criteria for resource tags, allowing filtering by tag key and value combinations."
        },
        "lookBackPeriodInDays": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/IntegerCriteriaCondition"
          },
          "description": "Filter criteria for the lookback period in days used to analyze resource utilization."
        },
        "restartNeeded": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/StringCriteriaCondition"
          },
          "description": "Filter criteria indicating whether the recommended action requires a resource restart."
        }
      }
    },
    "DoubleCriteriaCondition": {
      "type": "object",
      "properties": {
        "comparison": {
          "type": "string",
          "enum": [
            "StringEquals",
            "StringNotEquals",
            "StringEqualsIgnoreCase",
            "StringNotEqualsIgnoreCase",
            "StringLike",
            "StringNotLike",
            "NumericEquals",
            "NumericNotEquals",
            "NumericLessThan",
            "NumericLessThanEquals",
            "NumericGreaterThan",
            "NumericGreaterThanEquals",
            "StringEqualsIfExists",
            "StringNotEqualsIfExists",
            "StringEqualsIgnoreCaseIfExists",
            "StringNotEqualsIgnoreCaseIfExists",
            "StringLikeIfExists",
            "StringNotLikeIfExists",
            "NumericEqualsIfExists",
            "NumericNotEqualsIfExists",
            "NumericLessThanIfExists",
            "NumericLessThanEqualsIfExists",
            "NumericGreaterThanIfExists",
            "NumericGreaterThanEqualsIfExists"
          ],
          "description": "The comparison operator used to evaluate the attribute against the specified values."
        },
        "values": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "The list of double values to compare against using the specified comparison operator."
        }
      }
    },
    "IntegerCriteriaCondition": {
      "type": "object",
      "properties": {
        "comparison": {
          "type": "string",
          "enum": [
            "StringEquals",
            "StringNotEquals",
            "StringEqualsIgnoreCase",
            "StringNotEqualsIgnoreCase",
            "StringLike",
            "StringNotLike",
            "NumericEquals",
            "NumericNotEquals",
            "NumericLessThan",
            "NumericLessThanEquals",
            "NumericGreaterThan",
            "NumericGreaterThanEquals",
            "StringEqualsIfExists",
            "StringNotEqualsIfExists",
            "StringEqualsIgnoreCaseIfExists",
            "StringNotEqualsIgnoreCaseIfExists",
            "StringLikeIfExists",
            "StringNotLikeIfExists",
            "NumericEqualsIfExists",
            "NumericNotEqualsIfExists",
            "NumericLessThanIfExists",
            "NumericLessThanEqualsIfExists",
            "NumericGreaterThanIfExists",
            "NumericGreaterThanEqualsIfExists"
          ],
          "description": "The comparison operator used to evaluate the attribute against the specified values."
        },
        "values": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "The list of integer values to compare against using the specified comparison operator."
        }
      }
    },
    "OrganizationConfiguration": {
      "type": "object",
      "properties": {
        "ruleApplyOrder": {
          "type": "string",
          "enum": [
            "BeforeAccountRules",
            "AfterAccountRules"
          ],
          "description": "Specifies when organization rules should be applied relative to account rules."
        },
        "accountIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of specific Amazon Web Services account IDs where the organization rule should be applied."
        }
      }
    },
    "ResourceTagsCriteriaCondition": {
      "type": "object",
      "properties": {
        "comparison": {
          "type": "string",
          "enum": [
            "StringEquals",
            "StringNotEquals",
            "StringEqualsIgnoreCase",
            "StringNotEqualsIgnoreCase",
            "StringLike",
            "StringNotLike",
            "NumericEquals",
            "NumericNotEquals",
            "NumericLessThan",
            "NumericLessThanEquals",
            "NumericGreaterThan",
            "NumericGreaterThanEquals",
            "StringEqualsIfExists",
            "StringNotEqualsIfExists",
            "StringEqualsIgnoreCaseIfExists",
            "StringNotEqualsIgnoreCaseIfExists",
            "StringLikeIfExists",
            "StringNotLikeIfExists",
            "NumericEqualsIfExists",
            "NumericNotEqualsIfExists",
            "NumericLessThanIfExists",
            "NumericLessThanEqualsIfExists",
            "NumericGreaterThanIfExists",
            "NumericGreaterThanEqualsIfExists"
          ],
          "description": "The comparison operator used to evaluate the attribute against the specified values."
        },
        "key": {
          "type": "string",
          "description": "The tag key to use for comparison when filtering resources."
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of tag values to compare against when filtering resources."
        }
      }
    },
    "Schedule": {
      "type": "object",
      "properties": {
        "scheduleExpression": {
          "type": "string",
          "description": "The expression that defines when the schedule runs. cron expression is supported. A cron expression consists of six fields separated by white spaces: (minutes hours day_of_month month day_of_week year) You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (30 12 * * *) runs daily at 12:30 PM UTC."
        },
        "scheduleExpressionTimezone": {
          "type": "string",
          "description": "The timezone to use when interpreting the schedule expression."
        },
        "executionWindowInMinutes": {
          "type": "integer",
          "description": "The time window in minutes during which the automation rule can start implementing recommended actions."
        }
      }
    },
    "StringCriteriaCondition": {
      "type": "object",
      "properties": {
        "comparison": {
          "type": "string",
          "enum": [
            "StringEquals",
            "StringNotEquals",
            "StringEqualsIgnoreCase",
            "StringNotEqualsIgnoreCase",
            "StringLike",
            "StringNotLike",
            "NumericEquals",
            "NumericNotEquals",
            "NumericLessThan",
            "NumericLessThanEquals",
            "NumericGreaterThan",
            "NumericGreaterThanEquals",
            "StringEqualsIfExists",
            "StringNotEqualsIfExists",
            "StringEqualsIgnoreCaseIfExists",
            "StringNotEqualsIgnoreCaseIfExists",
            "StringLikeIfExists",
            "StringNotLikeIfExists",
            "NumericEqualsIfExists",
            "NumericNotEqualsIfExists",
            "NumericLessThanIfExists",
            "NumericLessThanEqualsIfExists",
            "NumericGreaterThanIfExists",
            "NumericGreaterThanEqualsIfExists"
          ],
          "description": "The comparison operator used to evaluate the attribute against the specified values."
        },
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of string values to compare against when applying the criteria condition."
        }
      }
    }
  }
}