{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-lightsail/json-schema/amazon-lightsail-create-distribution-request-schema.json",
  "title": "CreateDistributionRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-lightsail-distributions-api-openapi.yml#/components/schemas/CreateDistributionRequest",
  "type": "object",
  "properties": {
    "distributionName": {
      "allOf": [
        {
          "$ref": "#/$defs/ResourceName"
        }
      ],
      "description": "The name for the distribution."
    },
    "origin": {
      "allOf": [
        {
          "$ref": "#/$defs/InputOrigin"
        }
      ],
      "description": "An object that describes the origin resource for the distribution, such as a Lightsail instance, bucket, or load balancer. The distribution pulls, caches, and serves content from the origin."
    },
    "defaultCacheBehavior": {
      "allOf": [
        {
          "$ref": "#/$defs/CacheBehavior"
        }
      ],
      "description": "An object that describes the default cache behavior for the distribution."
    },
    "cacheBehaviorSettings": {
      "allOf": [
        {
          "$ref": "#/$defs/CacheSettings"
        }
      ],
      "description": "An object that describes the cache behavior settings for the distribution."
    },
    "cacheBehaviors": {
      "allOf": [
        {
          "$ref": "#/$defs/CacheBehaviorList"
        }
      ],
      "description": "An array of objects that describe the per-path cache behavior for the distribution."
    },
    "bundleId": {
      "allOf": [
        {
          "$ref": "#/$defs/string"
        }
      ],
      "description": "The bundle ID to use for the distribution. A distribution bundle describes the specifications of your distribution, such as the monthly cost and monthly network transfer quota. Use the GetDistributionBundles action to get a list of distribution bundle IDs that you can specify."
    },
    "ipAddressType": {
      "allOf": [
        {
          "$ref": "#/$defs/IpAddressType"
        }
      ],
      "description": "The IP address type for the distribution. The possible values are ipv4 for IPv4 only, and dualstack for IPv4 and IPv6. The default value is dualstack ."
    },
    "tags": {
      "allOf": [
        {
          "$ref": "#/$defs/TagList"
        }
      ],
      "description": "The tag keys and optional values to add to the distribution during create. Use the TagResource action to tag a resource after it's created."
    },
    "certificateName": {
      "allOf": [
        {
          "$ref": "#/$defs/ResourceName"
        }
      ],
      "description": "The name of the SSL/TLS certificate that you want to attach to the distribution. Use the GetCertificates action to get a list of certificate names that you can specify."
    },
    "viewerMinimumTlsProtocolVersion": {
      "allOf": [
        {
          "$ref": "#/$defs/ViewerMinimumTlsProtocolVersionEnum"
        }
      ],
      "description": "The minimum TLS protocol version for the SSL/TLS certificate."
    },
    "enablePrivateOriginAccess": {
      "allOf": [
        {
          "$ref": "#/$defs/boolean"
        }
      ],
      "description": "Specifies whether to enable private origin access for the distribution. With private origin access, the distribution can serve objects that aren't publicly accessible from a Lightsail bucket. Lightsail grants the distribution permission to read the bucket's objects. Enabling private origin access doesn't change the bucket's access settings, and you can still retrieve publicly accessible objects directly from the bucket's endpoint. You can enable private origin access only when the distribution's origin is a Lightsail bucket. If the origin is another resource type, the request fails."
    },
    "defaultRootObject": {
      "allOf": [
        {
          "$ref": "#/$defs/string"
        }
      ],
      "description": "The object (for example, index.html ) that the distribution returns when a viewer requests the root URL of the distribution ( / ) instead of a specific object. The object that you specify must be available from the origin."
    },
    "customErrorResponses": {
      "allOf": [
        {
          "$ref": "#/$defs/DistributionCustomErrorResponseList"
        }
      ],
      "description": "An array of objects that describe the custom error responses for the distribution. With a custom error response, you can specify the page to return when the origin responds with a given HTTP error code. You can also specify the HTTP status code to send to the viewer."
    }
  },
  "required": [
    "distributionName",
    "origin",
    "defaultCacheBehavior",
    "bundleId"
  ],
  "$defs": {
    "BehaviorEnum": {
      "type": "string",
      "enum": [
        "dont-cache",
        "cache"
      ]
    },
    "CacheBehavior": {
      "type": "object",
      "properties": {
        "behavior": {
          "allOf": [
            {
              "$ref": "#/$defs/BehaviorEnum"
            }
          ],
          "description": "The cache behavior of the distribution. The following cache behaviors can be specified: cache - This option is best for static sites. When specified, your distribution caches and serves your entire website as static content. This behavior is ideal for websites with static content that doesn't change depending on who views it, or for websites that don't use cookies, headers, or query strings to personalize content. dont-cache - This option is best for sites that serve a mix of static and dynamic content. When specified, your distribution caches and serve only the content that is specified in the distribution's CacheBehaviorPerPath parameter. This behavior is ideal for websites or web applications that use cookies, headers, and query strings to personalize content for individual users."
        }
      },
      "description": "Describes the default cache behavior of an Amazon Lightsail content delivery network (CDN) distribution."
    },
    "CacheBehaviorList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CacheBehaviorPerPath"
      }
    },
    "CacheBehaviorPerPath": {
      "type": "object",
      "properties": {
        "path": {
          "allOf": [
            {
              "$ref": "#/$defs/string"
            }
          ],
          "description": "The path to a directory or file to cached, or not cache. Use an asterisk symbol to specify wildcard directories ( path/to/assets/* ), and file types ( *.html, *jpg, *js ). Directories and file paths are case-sensitive. Examples: Specify the following to cache all files in the document root of an Apache web server running on a Lightsail instance. var/www/html/ Specify the following file to cache only the index page in the document root of an Apache web server. var/www/html/index.html Specify the following to cache only the .html files in the document root of an Apache web server. var/www/html/*.html Specify the following to cache only the .jpg, .png, and .gif files in the images sub-directory of the document root of an Apache web server. var/www/html/images/*.jpg var/www/html/images/*.png var/www/html/images/*.gif Specify the following to cache all files in the images sub-directory of the document root of an Apache web server. var/www/html/images/"
        },
        "behavior": {
          "allOf": [
            {
              "$ref": "#/$defs/BehaviorEnum"
            }
          ],
          "description": "The cache behavior for the specified path. You can specify one of the following per-path cache behaviors: cache - This behavior caches the specified path. dont-cache - This behavior doesn't cache the specified path."
        }
      },
      "description": "Describes the per-path cache behavior of an Amazon Lightsail content delivery network (CDN) distribution. A per-path cache behavior is used to override, or add an exception to, the default cache behavior of a distribution. For example, if the cacheBehavior is set to cache , then a per-path cache behavior can be used to specify a directory, file, or file type that your distribution will cache. Alternately, if the distribution's cacheBehavior is dont-cache , then a per-path cache behavior can be used to specify a directory, file, or file type that your distribution will not cache."
    },
    "CacheSettings": {
      "type": "object",
      "properties": {
        "defaultTTL": {
          "allOf": [
            {
              "$ref": "#/$defs/long"
            }
          ],
          "description": "The default amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the content has been updated. The value specified applies only when the origin does not add HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects."
        },
        "minimumTTL": {
          "allOf": [
            {
              "$ref": "#/$defs/long"
            }
          ],
          "description": "The minimum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated. A value of 0 must be specified for minimumTTL if the distribution is configured to forward all headers to the origin."
        },
        "maximumTTL": {
          "allOf": [
            {
              "$ref": "#/$defs/long"
            }
          ],
          "description": "The maximum amount of time that objects stay in the distribution's cache before the distribution forwards another request to the origin to determine whether the object has been updated. The value specified applies only when the origin adds HTTP headers such as Cache-Control max-age , Cache-Control s-maxage , and Expires to objects."
        },
        "allowedHTTPMethods": {
          "allOf": [
            {
              "$ref": "#/$defs/NonEmptyString"
            }
          ],
          "description": "The HTTP methods that are processed and forwarded to the distribution's origin. You can specify the following options: GET,HEAD - The distribution forwards the GET and HEAD methods. GET,HEAD,OPTIONS - The distribution forwards the GET , HEAD , and OPTIONS methods. GET,HEAD,OPTIONS,PUT,PATCH,POST,DELETE - The distribution forwards the GET , HEAD , OPTIONS , PUT , PATCH , POST , and DELETE methods. If you specify the third option, you might need to restrict access to your distribution's origin so users can't perform operations that you don't want them to. For example, you might not want users to have permission to delete objects from your origin."
        },
        "cachedHTTPMethods": {
          "allOf": [
            {
              "$ref": "#/$defs/NonEmptyString"
            }
          ],
          "description": "The HTTP method responses that are cached by your distribution. You can specify the following options: GET,HEAD - The distribution caches responses to the GET and HEAD methods. GET,HEAD,OPTIONS - The distribution caches responses to the GET , HEAD , and OPTIONS methods."
        },
        "forwardedCookies": {
          "allOf": [
            {
              "$ref": "#/$defs/CookieObject"
            }
          ],
          "description": "An object that describes the cookies that are forwarded to the origin. Your content is cached based on the cookies that are forwarded."
        },
        "forwardedHeaders": {
          "allOf": [
            {
              "$ref": "#/$defs/HeaderObject"
            }
          ],
          "description": "An object that describes the headers that are forwarded to the origin. Your content is cached based on the headers that are forwarded."
        },
        "forwardedQueryStrings": {
          "allOf": [
            {
              "$ref": "#/$defs/QueryStringObject"
            }
          ],
          "description": "An object that describes the query strings that are forwarded to the origin. Your content is cached based on the query strings that are forwarded."
        }
      },
      "description": "Describes the cache settings of an Amazon Lightsail content delivery network (CDN) distribution. These settings apply only to your distribution's cacheBehaviors (including the defaultCacheBehavior ) that have a behavior of cache ."
    },
    "CookieObject": {
      "type": "object",
      "properties": {
        "option": {
          "allOf": [
            {
              "$ref": "#/$defs/ForwardValues"
            }
          ],
          "description": "Specifies which cookies to forward to the distribution's origin for a cache behavior: all , none , or allow-list to forward only the cookies specified in the cookiesAllowList parameter."
        },
        "cookiesAllowList": {
          "allOf": [
            {
              "$ref": "#/$defs/StringList"
            }
          ],
          "description": "The specific cookies to forward to your distribution's origin."
        }
      },
      "description": "Describes whether an Amazon Lightsail content delivery network (CDN) distribution forwards cookies to the origin and, if so, which ones. For the cookies that you specify, your distribution caches separate versions of the specified content based on the cookie values in viewer requests."
    },
    "DistributionCustomErrorResponse": {
      "type": "object",
      "properties": {
        "errorCode": {
          "allOf": [
            {
              "$ref": "#/$defs/integer"
            }
          ],
          "description": "The HTTP error code from the origin that triggers the custom error response (for example, 403 or 404 )."
        },
        "responseCode": {
          "allOf": [
            {
              "$ref": "#/$defs/string"
            }
          ],
          "description": "The HTTP status code that the distribution returns to the viewer for the custom error response."
        },
        "responsePagePath": {
          "allOf": [
            {
              "$ref": "#/$defs/string"
            }
          ],
          "description": "The path to the custom error page that the distribution returns to the viewer (for example, /404.html ). The path must begin with a forward slash ( / ) and reference an object that is available from the origin."
        },
        "errorCachingMinTTL": {
          "allOf": [
            {
              "$ref": "#/$defs/long"
            }
          ],
          "description": "The minimum time, in seconds, that the distribution caches the custom error response before requesting the object again from the origin. If you don't specify a value, the default is 10 seconds."
        }
      },
      "description": "Describes a custom error response for a Lightsail distribution. A custom error response specifies the page that the distribution returns to the viewer. It also specifies the HTTP status code that the distribution sends when the origin responds with a given HTTP error code."
    },
    "DistributionCustomErrorResponseList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DistributionCustomErrorResponse"
      }
    },
    "ForwardValues": {
      "type": "string",
      "enum": [
        "none",
        "allow-list",
        "all"
      ]
    },
    "HeaderEnum": {
      "type": "string",
      "enum": [
        "Accept",
        "Accept-Charset",
        "Accept-Datetime",
        "Accept-Encoding",
        "Accept-Language",
        "Authorization",
        "CloudFront-Forwarded-Proto",
        "CloudFront-Is-Desktop-Viewer",
        "CloudFront-Is-Mobile-Viewer",
        "CloudFront-Is-SmartTV-Viewer",
        "CloudFront-Is-Tablet-Viewer",
        "CloudFront-Viewer-Country",
        "Host",
        "Origin",
        "Referer"
      ]
    },
    "HeaderForwardList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HeaderEnum"
      }
    },
    "HeaderObject": {
      "type": "object",
      "properties": {
        "option": {
          "allOf": [
            {
              "$ref": "#/$defs/ForwardValues"
            }
          ],
          "description": "The headers that you want your distribution to forward to your origin and base caching on. You can configure your distribution to do one of the following: all - Forward all headers to your origin. none - Forward only the default headers. allow-list - Forward only the headers you specify using the headersAllowList parameter."
        },
        "headersAllowList": {
          "allOf": [
            {
              "$ref": "#/$defs/HeaderForwardList"
            }
          ],
          "description": "The specific headers to forward to your distribution's origin."
        }
      },
      "description": "Describes the request headers that a Lightsail distribution bases caching on. For the headers that you specify, your distribution caches separate versions of the specified content based on the header values in viewer requests. For example, suppose viewer requests for logo.jpg contain a custom product header that has a value of either acme or apex , and you configure your distribution to cache your content based on values in the product header. Your distribution forwards the product header to the origin and caches the response from the origin once for each header value."
    },
    "InputOrigin": {
      "type": "object",
      "properties": {
        "name": {
          "allOf": [
            {
              "$ref": "#/$defs/ResourceName"
            }
          ],
          "description": "The name of the origin resource."
        },
        "regionName": {
          "allOf": [
            {
              "$ref": "#/$defs/RegionName"
            }
          ],
          "description": "The AWS Region name of the origin resource."
        },
        "protocolPolicy": {
          "allOf": [
            {
              "$ref": "#/$defs/OriginProtocolPolicyEnum"
            }
          ],
          "description": "The protocol that your Amazon Lightsail distribution uses when establishing a connection with your origin to pull content."
        },
        "responseTimeout": {
          "allOf": [
            {
              "$ref": "#/$defs/integer"
            }
          ],
          "description": "The amount of time, in seconds, that the distribution waits for a response after forwarding a request to the origin. The minimum timeout is 1 second, the maximum is 60 seconds, and the default (if you don't specify otherwise) is 30 seconds."
        },
        "ipAddressType": {
          "allOf": [
            {
              "$ref": "#/$defs/OriginIpAddressTypeEnum"
            }
          ],
          "description": "The IP address type that the distribution uses when connecting to the origin. The possible values are ipv4 for IPv4 only, ipv6 for IPv6 only, and dualstack for IPv4 and IPv6."
        }
      },
      "description": "Describes the origin resource of an Amazon Lightsail content delivery network (CDN) distribution. An origin can be a Lightsail instance, bucket, container service, or load balancer. A distribution pulls content from an origin, caches it, and serves it to viewers via a worldwide network of edge servers."
    },
    "IpAddressType": {
      "type": "string",
      "enum": [
        "dualstack",
        "ipv4",
        "ipv6"
      ]
    },
    "NonEmptyString": {
      "type": "string",
      "pattern": "\\S"
    },
    "OriginIpAddressTypeEnum": {
      "type": "string",
      "enum": [
        "ipv4",
        "ipv6",
        "dualstack"
      ]
    },
    "OriginProtocolPolicyEnum": {
      "type": "string",
      "enum": [
        "http-only",
        "https-only"
      ]
    },
    "QueryStringObject": {
      "type": "object",
      "properties": {
        "option": {
          "allOf": [
            {
              "$ref": "#/$defs/boolean"
            }
          ],
          "description": "Indicates whether the distribution forwards and caches based on query strings."
        },
        "queryStringsAllowList": {
          "allOf": [
            {
              "$ref": "#/$defs/StringList"
            }
          ],
          "description": "The specific query strings that the distribution forwards to the origin. Your distribution will cache content based on the specified query strings. If the option parameter is true, then your distribution forwards all query strings, regardless of what you specify using the queryStringsAllowList parameter."
        }
      },
      "description": "Describes the query string parameters that an Amazon Lightsail content delivery network (CDN) distribution to bases caching on. For the query strings that you specify, your distribution caches separate versions of the specified content based on the query string values in viewer requests."
    },
    "RegionName": {
      "type": "string",
      "enum": [
        "us-east-1",
        "us-east-2",
        "us-west-1",
        "us-west-2",
        "eu-west-1",
        "eu-west-2",
        "eu-west-3",
        "eu-central-1",
        "eu-north-1",
        "eu-south-2",
        "ca-central-1",
        "ap-east-1",
        "ap-south-1",
        "ap-southeast-1",
        "ap-southeast-2",
        "ap-northeast-1",
        "ap-northeast-2",
        "ap-southeast-3",
        "ap-southeast-5",
        "sa-east-1"
      ]
    },
    "ResourceName": {
      "type": "string",
      "pattern": "^\\w[\\w\\-]*\\w$"
    },
    "StringList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/string"
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "key": {
          "allOf": [
            {
              "$ref": "#/$defs/TagKey"
            }
          ],
          "description": "The key of the tag. Constraints: Tag keys accept a maximum of 128 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @"
        },
        "value": {
          "allOf": [
            {
              "$ref": "#/$defs/TagValue"
            }
          ],
          "description": "The value of the tag. Constraints: Tag values accept a maximum of 256 letters, numbers, spaces in UTF-8, or the following characters: + - = . _ : / @"
        }
      },
      "description": "Describes a tag key and optional value assigned to an Amazon Lightsail resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide ."
    },
    "TagKey": {
      "type": "string"
    },
    "TagList": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      }
    },
    "TagValue": {
      "type": "string"
    },
    "ViewerMinimumTlsProtocolVersionEnum": {
      "type": "string",
      "enum": [
        "TLSv1.1_2016",
        "TLSv1.2_2018",
        "TLSv1.2_2019",
        "TLSv1.2_2021"
      ]
    },
    "boolean": {
      "type": "boolean"
    },
    "integer": {
      "type": "integer"
    },
    "long": {
      "type": "integer"
    },
    "string": {
      "type": "string"
    }
  }
}