{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-route53-resolver/json-schema/amazon-route53-resolver-create-resolver-rule-request-schema.json",
  "title": "CreateResolverRuleRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-route53-resolver-amazon-route-53-resolver-api-openapi.yml#/components/schemas/CreateResolverRuleRequest",
  "type": "object",
  "properties": {
    "CreatorRequestId": {
      "type": "string",
      "description": "A unique string that identifies the request and that allows failed requests to be retried without the risk of running the operation twice. CreatorRequestId can be any unique string, for example, a date/time stamp."
    },
    "Name": {
      "type": "string",
      "description": "A friendly name that lets you easily find a rule in the Resolver dashboard in the Route 53 console. The name can be up to 64 characters long and can contain letters (a-z, A-Z), numbers (0-9), hyphens (-), underscores (_), and spaces. The name cannot consist of only numbers."
    },
    "RuleType": {
      "type": "string",
      "enum": [
        "FORWARD",
        "SYSTEM",
        "RECURSIVE",
        "DELEGATE"
      ],
      "description": "When you want to forward DNS queries for specified domain name to resolvers on your network, specify FORWARD or DELEGATE. When you have a forwarding rule to forward DNS queries for a domain to your network and you want Resolver to process queries for a subdomain of that domain, specify SYSTEM. For example, to forward DNS queries for example.com to resolvers on your network, you create a rule and specify FORWARD for RuleType. To then have Resolver process queries for apex.example.com, you create a rule and specify SYSTEM for RuleType. Currently, only Resolver can create rules that have a value "
    },
    "DomainName": {
      "type": "string",
      "description": "DNS queries for this domain name are forwarded to the IP addresses that you specify in TargetIps. If a query matches multiple Resolver rules (example.com and www.example.com), outbound DNS queries are routed using the Resolver rule that contains the most specific domain name (www.example.com)."
    },
    "TargetIps": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TargetAddress"
      },
      "description": "The IPs that you want Resolver to forward DNS queries to. You can specify either Ipv4 or Ipv6 addresses but not both in the same rule. Separate IP addresses with a space. TargetIps is available only when the value of Rule type is FORWARD. You should not provide TargetIps when the Rule type is DELEGATE. when creating a DELEGATE rule, you must not provide the TargetIps parameter. If you provide the TargetIps, you may receive an ERROR message similar to \"Delegate resolver rules need to specify a nameserver name\". This error means you should not provide TargetIps."
    },
    "ResolverEndpointId": {
      "type": "string",
      "description": "The ID of the outbound Resolver endpoint that you want to use to route DNS queries to the IP addresses that you specify in TargetIps."
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "A list of the tag keys and values that you want to associate with the endpoint."
    },
    "DelegationRecord": {
      "type": "string",
      "description": "DNS queries with the delegation records that match this domain name are forwarded to the resolvers on your network."
    }
  },
  "required": [
    "CreatorRequestId",
    "RuleType"
  ],
  "$defs": {
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The name for the tag. For example, if you want to associate Resolver resources with the account IDs of your customers for billing purposes, the value of Key might be account-id."
        },
        "Value": {
          "type": "string",
          "description": "The value for the tag. For example, if Key is account-id, then Value might be the ID of the customer account that you're creating the resource for."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    },
    "TargetAddress": {
      "type": "object",
      "properties": {
        "Ip": {
          "type": "string",
          "description": "One IPv4 address that you want to forward DNS queries to."
        },
        "Port": {
          "type": "integer",
          "description": "The port at Ip that you want to forward DNS queries to."
        },
        "Ipv6": {
          "type": "string",
          "description": "One IPv6 address that you want to forward DNS queries to."
        },
        "Protocol": {
          "type": "string",
          "enum": [
            "DoH",
            "Do53",
            "DoH-FIPS"
          ],
          "description": "The protocols for the target address. The protocol you choose needs to be supported by the outbound endpoint of the Resolver rule."
        },
        "ServerNameIndication": {
          "type": "string",
          "description": "The Server Name Indication of the DoH server that you want to forward queries to. This is only used if the Protocol of the TargetAddress is DoH."
        }
      }
    }
  }
}