In short. Repeated query parameters share one field, with the first value in value and all occurrences in multiValue.
Definition: In a CloudFront function event,
querystringis an object whose fields are named after the query parameters. When a request repeats a parameter name, CloudFront keeps one field, places the first value invalue, and adds amultiValuearray containing the repeated values.
Key facts
- The
requestobject includes an emptyquerystringobject even when the request has no query string, according to Amazon CloudFront's function event reference. - The
querystringobject has one field for each query string parameter, and each field has avalueproperty. - Repeated query string names are collapsed into one field with a
multiValueproperty whose array contains the values of the duplicates. - The first value appears in both
valueand the first object inmultiValue, so looping throughmultiValueexposes the complete repeated sequence. - A function can create or update a query string for a viewer request, while a viewer response function can read it but cannot create or update it, as documented in AWS's edge function restrictions.
What does the query string look like in the event?
The event reference treats query strings, headers, and cookies as the same general structure. A parameter name is a field inside request.querystring, and its field contains the parameter value. An absent query string therefore produces an object that can be read without assuming that a string is present.
For a request with color=red and page=2, the relevant shape is:
"querystring": {
"color": {"value": "red"},
"page": {"value": "2"}
}
The field names preserve the parameter names shown in the event reference's example, such as ID, Exp, TTL, and NoValue. An empty parameter is represented by an empty string in value, as in "NoValue": {"value": ""}.
What changes when a name is repeated?
Suppose the request contains tag=one&tag=two&tag=three. CloudFront does not create three sibling tag fields. It collapses the duplicate name into one field and represents the values as objects in multiValue:
"querystring": {
"tag": {
"value": "one",
"multiValue": [
{"value": "one"},
{"value": "two"},
{"value": "three"}
]
}
}
The event reference says that multiValue is used when the HTTP request contains duplicate query strings with the same name. It also distinguishes that case from multiple values in one query string, where multiValue is not used. The array is therefore the field to inspect when code must preserve or process each occurrence of a repeated name.
Can a function change the repeated values?
CloudFront applies a specific precedence rule when code changes a field that has multiValue. If the function modifies the multiValue array, CloudFront applies that array modification and ignores the first element in value. If the array is left unchanged, a modification to value is applied while later values remain unchanged.
For event direction, AWS documents that a function can create or update a query string for viewer request events. A viewer response function can read the query string but cannot create or update it. This distinction matters when code needs to normalize a repeated parameter before the request continues.
What limits apply when code writes it?
AWS's edge function restrictions state that a created or updated query string cannot contain spaces, control characters, or the fragment identifier #. The complete URI, including its query string, must be less than 8,192 characters. Values passed to edge functions are UTF-8 encoded, and AWS recommends UTF-8 for values returned by the function.
Related terms
- Does changing a URI in CloudFront Functions change the selected origin?
- Can a CloudFront response event function change query parameters?
- URL parameters
FAQ
Is value enough for a repeated parameter?
No. For a duplicate query string name, value contains the first value. Read multiValue when the function must access every value.
Does a comma create a multiValue array?
No. AWS documents multiValue for duplicate names. Multiple values inside one query string do not use that property.
Can a viewer response function rewrite the query string?
No. It can read the query string, while query-string creation or updates are allowed for viewer request events.
Sources
- Amazon CloudFront, "CloudFront Functions event structure", accessed 17 October 2026
- Amazon CloudFront, "Restrictions on all edge functions", accessed 17 October 2026
Check how a page reads to answer engines. Open the GEO score analyzer