{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-lookoutmetrics-alert.json",
  "title": "AWSLookoutMetricsAlertProperties",
  "description": "Resource Type definition for AWS::LookoutMetrics::Alert. Source:- <https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-lookout-for-metrics.git>",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-lookoutmetrics-alert.json",
    "sourceSha256": "3986421463a55ac0a7df66210db57f14a75eaadaf244b4a6a4b05bccab3482c7"
  },
  "type": "object",
  "properties": {
    "AlertName": {
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 63,
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]*"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The name of the alert. If not provided, a name is generated automatically."
    },
    "AlertDescription": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 256,
          "pattern": ".*\\S.*"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "A description for the alert."
    },
    "AnomalyDetectorArn": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 256,
          "pattern": "arn:([a-z0-9-]+):.*:.*:.*:.+"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "description": "The Amazon resource name (ARN) of the Anomaly Detector to alert."
    },
    "AlertSensitivityThreshold": {
      "description": "A number between 0 and 100 (inclusive) that tunes the sensitivity of the alert.",
      "type": "integer",
      "minimum": 0,
      "maximum": 100
    },
    "Action": {
      "description": "The action to be taken by the alert when an anomaly is detected.",
      "$ref": "#/$defs/Action"
    }
  },
  "typeName": "AWS::LookoutMetrics::Alert",
  "primaryIdentifier": [
    "/properties/Arn"
  ],
  "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-resource-providers-lookout-for-metrics.git",
  "additionalProperties": false,
  "readOnlyProperties": [
    "/properties/Arn"
  ],
  "$defs": {
    "Arn": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 256,
          "pattern": "arn:([a-z0-9-]+):.*:.*:.*:.+"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ],
      "title": "AWSLookoutMetricsAlertArnDefinition"
    },
    "Action": {
      "type": "object",
      "title": "AWSLookoutMetricsAlertActionDefinition",
      "properties": {
        "SNSConfiguration": {
          "$ref": "#/$defs/SNSConfiguration"
        },
        "LambdaConfiguration": {
          "$ref": "#/$defs/LambdaConfiguration"
        }
      },
      "additionalProperties": false
    },
    "SNSConfiguration": {
      "description": "Configuration options for an SNS alert action.",
      "type": "object",
      "title": "AWSLookoutMetricsAlertSNSConfigurationDefinition",
      "properties": {
        "RoleArn": {
          "description": "ARN of an IAM role that LookoutMetrics should assume to access the SNS topic.",
          "$ref": "#/$defs/Arn"
        },
        "SnsTopicArn": {
          "description": "ARN of an SNS topic to send alert notifications to.",
          "$ref": "#/$defs/Arn"
        }
      },
      "required": [
        "RoleArn",
        "SnsTopicArn"
      ],
      "additionalProperties": false
    },
    "LambdaConfiguration": {
      "description": "Configuration options for a Lambda alert action.",
      "type": "object",
      "title": "AWSLookoutMetricsAlertLambdaConfigurationDefinition",
      "properties": {
        "RoleArn": {
          "description": "ARN of an IAM role that LookoutMetrics should assume to access the Lambda function.",
          "$ref": "#/$defs/Arn"
        },
        "LambdaArn": {
          "description": "ARN of a Lambda to send alert notifications to.",
          "$ref": "#/$defs/Arn"
        }
      },
      "required": [
        "RoleArn",
        "LambdaArn"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "AnomalyDetectorArn",
    "AlertSensitivityThreshold",
    "Action"
  ],
  "createOnlyProperties": [
    "/properties/AlertName",
    "/properties/AlertDescription",
    "/properties/AnomalyDetectorArn",
    "/properties/AlertSensitivityThreshold",
    "/properties/Action"
  ]
}
