{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--aws-vpclattice-rule.json",
  "title": "AWSVpcLatticeRuleProperties",
  "description": "Creates a listener rule. Each listener has a default rule for checking connection requests, but you can define additional rules. Each rule consists of a priority, one or more actions, and one or more conditions.. Source:- No source definition found, add manually please",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lalcebo/json-schema/master/serverless/resources/cloudformation-modified/aws-vpclattice-rule.json",
    "sourceSha256": "21e44f6226bbc1205a3f3dbf2c99cb7c328c18c9f58c223c79850d22dc449332"
  },
  "type": "object",
  "properties": {
    "Action": {
      "$ref": "#/$defs/Action"
    },
    "ListenerIdentifier": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 2048,
          "minLength": 20,
          "pattern": "^((listener-[0-9a-z]{17})|(arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:service/svc-[0-9a-z]{17}/listener/listener-[0-9a-z]{17}))$"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ]
    },
    "Match": {
      "$ref": "#/$defs/Match"
    },
    "Name": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 63,
          "minLength": 3,
          "pattern": "^(?!rule-)(?![-])(?!.*[-]$)(?!.*[-]{2})[a-z0-9-]+$"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ]
    },
    "Priority": {
      "type": "integer",
      "maximum": 100,
      "minimum": 1
    },
    "ServiceIdentifier": {
      "oneOf": [
        {
          "type": "string",
          "maxLength": 2048,
          "minLength": 20,
          "pattern": "^((svc-[0-9a-z]{17})|(arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:service/svc-[0-9a-z]{17}))$"
        },
        {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
        }
      ]
    },
    "Tags": {
      "type": "array",
      "insertionOrder": false,
      "uniqueItems": true,
      "minItems": 0,
      "maxItems": 50,
      "items": {
        "$ref": "#/$defs/Tag"
      }
    }
  },
  "typeName": "AWS::VpcLattice::Rule",
  "tagging": {
    "taggable": true,
    "tagOnCreate": true,
    "tagUpdatable": true,
    "cloudFormationSystemTags": false,
    "tagProperty": "/properties/Tags"
  },
  "$defs": {
    "Forward": {
      "type": "object",
      "properties": {
        "TargetGroups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WeightedTargetGroup"
          },
          "maxItems": 2,
          "minItems": 1,
          "insertionOrder": false
        }
      },
      "required": [
        "TargetGroups"
      ],
      "title": "AWSVpcLatticeRuleForwardDefinition",
      "additionalProperties": false
    },
    "FixedResponse": {
      "type": "object",
      "title": "AWSVpcLatticeRuleFixedResponseDefinition",
      "properties": {
        "StatusCode": {
          "type": "integer",
          "maximum": 599,
          "minimum": 100
        }
      },
      "required": [
        "StatusCode"
      ],
      "additionalProperties": false
    },
    "HeaderMatch": {
      "type": "object",
      "properties": {
        "Name": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 40,
              "minLength": 1
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Match": {
          "$ref": "#/$defs/HeaderMatchType"
        },
        "CaseSensitive": {
          "type": "boolean",
          "default": false
        }
      },
      "required": [
        "Match",
        "Name"
      ],
      "title": "AWSVpcLatticeRuleHeaderMatchDefinition",
      "additionalProperties": false
    },
    "HeaderMatchType": {
      "type": "object",
      "title": "AWSVpcLatticeRuleHeaderMatchTypeDefinition",
      "properties": {
        "Exact": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 128,
              "minLength": 1
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Prefix": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 128,
              "minLength": 1
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Contains": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 128,
              "minLength": 1
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "HttpMatch": {
      "type": "object",
      "properties": {
        "Method": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "CONNECT",
                "DELETE",
                "GET",
                "HEAD",
                "OPTIONS",
                "POST",
                "PUT",
                "TRACE"
              ]
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "PathMatch": {
          "$ref": "#/$defs/PathMatch"
        },
        "HeaderMatches": {
          "type": "array",
          "maxItems": 5,
          "items": {
            "$ref": "#/$defs/HeaderMatch"
          },
          "insertionOrder": false
        }
      },
      "title": "AWSVpcLatticeRuleHttpMatchDefinition",
      "additionalProperties": false
    },
    "PathMatch": {
      "type": "object",
      "title": "AWSVpcLatticeRulePathMatchDefinition",
      "properties": {
        "Match": {
          "$ref": "#/$defs/PathMatchType"
        },
        "CaseSensitive": {
          "type": "boolean",
          "default": false
        }
      },
      "required": [
        "Match"
      ],
      "additionalProperties": false
    },
    "PathMatchType": {
      "type": "object",
      "title": "AWSVpcLatticeRulePathMatchTypeDefinition",
      "properties": {
        "Exact": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^\\/[a-zA-Z0-9@:%_+.~#?&\\/=-]*$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Prefix": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 128,
              "minLength": 1,
              "pattern": "^\\/[a-zA-Z0-9@:%_+.~#?&\\/=-]*$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "Action": {
      "type": "object",
      "title": "Forward",
      "properties": {
        "Forward": {
          "$ref": "#/$defs/Forward"
        },
        "FixedResponse": {
          "$ref": "#/$defs/FixedResponse"
        }
      },
      "required": [],
      "additionalProperties": false
    },
    "Match": {
      "type": "object",
      "title": "HttpMatch",
      "properties": {
        "HttpMatch": {
          "$ref": "#/$defs/HttpMatch"
        }
      },
      "required": [
        "HttpMatch"
      ],
      "additionalProperties": false
    },
    "WeightedTargetGroup": {
      "type": "object",
      "properties": {
        "TargetGroupIdentifier": {
          "oneOf": [
            {
              "type": "string",
              "maxLength": 2048,
              "minLength": 20,
              "pattern": "^((tg-[0-9a-z]{17})|(arn:[a-z0-9\\-]+:vpc-lattice:[a-zA-Z0-9\\-]+:\\d{12}:targetgroup/tg-[0-9a-z]{17}))$"
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Weight": {
          "type": "integer",
          "maximum": 999,
          "minimum": 1
        }
      },
      "required": [
        "TargetGroupIdentifier"
      ],
      "title": "AWSVpcLatticeRuleWeightedTargetGroupDefinition",
      "additionalProperties": false
    },
    "Tag": {
      "type": "object",
      "title": "AWSVpcLatticeRuleTagDefinition",
      "properties": {
        "Key": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        },
        "Value": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            },
            {
              "$ref": "https://catalog.lintel.tools/schemas/schemastore/serverless-framework-configuration/_shared/latest--cf.functions.json#/Aws_CF_FunctionString"
            }
          ]
        }
      },
      "required": [
        "Key",
        "Value"
      ],
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "additionalIdentifiers": [
    [
      "/properties/ServiceIdentifier",
      "/properties/ListenerIdentifier",
      "/properties/Name"
    ]
  ],
  "propertyTransform": {
    "/properties/Action/Forward/TargetGroups/*/TargetGroupIdentifier": "$split(TargetGroupIdentifier, \"/\")[-1]"
  },
  "required": [
    "Action",
    "Match",
    "Priority"
  ],
  "readOnlyProperties": [
    "/properties/Arn",
    "/properties/Id"
  ],
  "createOnlyProperties": [
    "/properties/ListenerIdentifier",
    "/properties/ServiceIdentifier",
    "/properties/Name"
  ],
  "writeOnlyProperties": [
    "/properties/ListenerIdentifier",
    "/properties/ServiceIdentifier"
  ],
  "primaryIdentifier": [
    "/properties/Arn"
  ]
}
