Repository: getmoto/moto

Issue:
DynamoDB update_item doesn't raise error if unused ExpressionAttributeValue is passed
Testing with the following script:

```python
import traceback

import boto3
from moto import mock_aws


def bad_update(table):
    table.update_item(
        Key={"pk": "foo", "sk": "bar"},
        UpdateExpression="SET x = :one",
        ExpressionAttributeValues={":one": 1, ":something_else": 2},
    )


@mock_aws
def moto_test():
    dynamodb = boto3.resource("dynamodb", region_name="eu-west-1")
    table = dynamodb.create_table(
        AttributeDefinitions=[
            {"AttributeName": "pk", "AttributeType": "S"},
            {"AttributeName": "sk", "AttributeType": "S"},
        ],
        TableName="test-table",
        KeySchema=[
            {"AttributeName": "pk", "KeyType": "HASH"},
            {"AttributeName": "sk", "KeyType": "RANGE"},
        ],
        BillingMode="PAY_PER_REQUEST",
    )

    bad_update(table)


def boto_test():
    dynamodb = boto3.resource("dynamodb", region_name="eu-west-1")
    table = dynamodb.Table("test-table")

    bad_update(table)


print("moto_test:")
try:
    moto_test()
    print("Success!")
except:
    traceback.print_exc()


print("boto_test:")
try:
    boto_test()
    print("Success!")
except:
    traceback.print_exc()
```

I get this output:

```
moto_test:
Success!
boto_test:
Traceback (most recent call last):
  File "[snip]/moto-test/main.py", line 51, in <module>
    boto_test()
    ~~~~~~~~~^^
  File "[snip]/moto-test/main.py", line 38, in boto_test
    bad_update(table)
    ~~~~~~~~~~^^^^^^^
  File "[snip]/moto-test/main.py", line 8, in bad_update
    table.update_item(
    ~~~~~~~~~~~~~~~~~^
        Key={"pk": "foo", "sk": "bar"},
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        UpdateExpression="SET x = :one",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        ExpressionAttributeValues={":one": 1, ":something_else": 2},
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "[snip]/moto-test/.venv/lib/python3.13/site-packages/boto3/resources/factory.py", line 581, in do_action
    response = action(self, *args, **kwargs)
  File "[snip]/moto-test/.venv/lib/python3.13/site-packages/boto3/resources/action.py", line 88, in __call__
    response = getattr(parent.meta.client, operation_name)(*args, **params)
  File "[snip]/moto-test/.venv/lib/python3.13/site-packages/botocore/client.py", line 570, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "[snip]/moto-test/.venv/lib/python3.13/site-packages/botocore/context.py", line 124, in wrapper
    return func(*args, **kwargs)
  File "[snip]/moto-test/.venv/lib/python3.13/site-packages/botocore/client.py", line 1031, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the UpdateItem operation: Value provided in ExpressionAttributeValues unused in expressions: keys: {:something_else}
```

Environment:
* moto = 5.1.1
* boto3 = 1.37.11
* python = 3.13.1
* OS = Linux 6.13.5-arch1-1

Discussion:
@t-veor: Additionally moto doesn't raise a validation error if an empty set is passed as an ExpressionAttributeValue either, whereas AWS does. Replacing the `bad_update` function with the following:

```python
def bad_update(table):
    table.update_item(
        Key={"pk": "foo", "sk": "bar"},
        UpdateExpression="SET x = :one",
        ExpressionAttributeValues={":one": set()},
    )
```

Works with moto, but I get this error from boto3:
```
botocore.exceptions.ClientError: An error occurred (ValidationException) when calling the UpdateItem operation: ExpressionAttributeValues contains invalid value: One or more parameter values were invalid: An number set  may not be empty for key :one
```

Solution patch:
diff --git a/moto/dynamodb/comparisons.py b/moto/dynamodb/comparisons.py
index e8c6899c7..e86dc5713 100644
--- a/moto/dynamodb/comparisons.py
+++ b/moto/dynamodb/comparisons.py
@@ -160,6 +160,7 @@ class ConditionExpressionParser:
         self.expression_attribute_values = expression_attribute_values
 
         self.expr_attr_names_found: List[str] = []
+        self.expr_attr_values_found: List[str] = []
 
     def parse(self) -> Union[Op, "Func"]:
         """Returns a syntax tree for the expression.
@@ -214,6 +215,7 @@ class ConditionExpressionParser:
         node = nodes[0]
 
         self.expr_attr_names_found.extend(self._find_literals(node))
+        self.expr_attr_values_found.extend(self._find_expr_attr_values(node))
 
         op = self._make_op_condition(node)
         return op
@@ -264,13 +266,26 @@ class ConditionExpressionParser:
     @classmethod
     def _find_literals(cls, parent: Node) -> List[str]:  # type: ignore
         literals: List[str] = []
-        if parent.kind == "LITERAL" and parent.nonterminal == "IDENTIFIER":
+        if (
+            parent.kind == cls.Kind.LITERAL
+            and parent.nonterminal == cls.Nonterminal.IDENTIFIER
+        ):
             literals.append(parent.text)
         else:
             for child in parent.children:
                 literals.extend(cls._find_literals(child))
         return literals
 
+    @classmethod
+    def _find_expr_attr_values(cls, parent: Node) -> List[str]:  # type: ignore
+        literals: List[str] = []
+        if parent.kind == ConditionExpressionParser.Kind.EXPRESSION_ATTRIBUTE_VALUE:
+            literals.append(parent.text)
+        else:
+            for child in parent.children:
+                literals.extend(cls._find_expr_attr_values(child))
+        return literals
+
     @classmethod
     def raise_exception_if_keyword(cls, attribute: str) -> None:
         if attribute.upper() in ReservedKeywords.get_reserved_keywords():
diff --git a/moto/dynamodb/responses.py b/moto/dynamodb/responses.py
index 709ef7897..d865837da 100644
--- a/moto/dynamodb/responses.py
+++ b/moto/dynamodb/responses.py
@@ -11,6 +11,7 @@ from moto.dynamodb.models import DynamoDBBackend, Table, dynamodb_backends
 from moto.dynamodb.models.utilities import dynamo_json_dump
 from moto.dynamodb.parsing.expressions import (  # type: ignore
     ExpressionAttributeName,
+    ExpressionAttributeValue,
     UpdateExpressionParser,
 )
 from moto.dynamodb.parsing.key_condition_expression import parse_expression
@@ -157,15 +158,16 @@ def validate_put_has_gsi_keys_set_to_none(item: Dict[str, Any], table: Table) ->
                 )
 
 
-def validate_attribute_names_used(
-    attribute_names: Optional[Dict[str, str]], names_used: List[str]
+def validate_attributes_used(
+    attribute_names: Optional[Dict[str, Any]],
+    names_used: List[str],
+    provided_attr: str = "Names",
 ) -> None:
-    if attribute_names:
-        for name in attribute_names:
-            if name not in names_used:
-                raise MockValidationException(
-                    f"Value provided in ExpressionAttributeNames unused in expressions: keys: {{{name}}}"
-                )
+    for name in attribute_names or []:
+        if name not in names_used:
+            raise MockValidationException(
+                f"Value provided in ExpressionAttribute{provided_attr} unused in expressions: keys: {{{name}}}"
+            )
 
 
 def check_projection_expression(expression: str) -> None:
@@ -559,7 +561,7 @@ class DynamoHandler(BaseResponse):
             expression_attribute_values,
         )
         parser.parse()
-        validate_attribute_names_used(
+        validate_attributes_used(
             expression_attribute_names, parser.expr_attr_names_found
         )
 
@@ -666,7 +668,7 @@ class DynamoHandler(BaseResponse):
         )
         projection_expressions = parser.parse()
 
-        validate_attribute_names_used(
+        validate_attributes_used(
             expression_attribute_names, parser.expr_attr_names_found
         )
 
@@ -722,7 +724,7 @@ class DynamoHandler(BaseResponse):
                 projection_expression, expression_attribute_names
             )
             projection_expressions = parser.parse()
-            validate_attribute_names_used(
+            validate_attributes_used(
                 expression_attribute_names, parser.expr_attr_names_found
             )
 
@@ -839,7 +841,7 @@ class DynamoHandler(BaseResponse):
             if query_filters:
                 filter_kwargs.update(query_filters)
 
-        validate_attribute_names_used(
+        validate_attributes_used(
             expression_attribute_names, expression_attribute_names_used
         )
         index_name = self.body.get("IndexName")
@@ -936,7 +938,7 @@ class DynamoHandler(BaseResponse):
                 f"The Segment parameter is zero-based and must be less than parameter TotalSegments: Segment: {segment} is not less than TotalSegments: {total_segments}"
             )
 
-        validate_attribute_names_used(
+        validate_attributes_used(
             expression_attribute_names, expression_attribute_names_used
         )
 
@@ -993,7 +995,7 @@ class DynamoHandler(BaseResponse):
             expression_attribute_values,
         )
         parser.parse()
-        validate_attribute_names_used(
+        validate_attributes_used(
             expression_attribute_names, parser.expr_attr_names_found
         )
 
@@ -1028,6 +1030,8 @@ class DynamoHandler(BaseResponse):
         if not all([k in table.attribute_keys for k in key]):
             raise ProvidedKeyDoesNotExist
 
+        expression_attribute_names_used = []
+        expression_attribute_values_used = []
         if update_expression is not None:
             update_expression = update_expression.strip()
             if update_expression == "":
@@ -1041,10 +1045,15 @@ class DynamoHandler(BaseResponse):
             expression_attribute_names_used = [
                 attr.get_attribute_name_placeholder() for attr in attr_name_clauses
             ]
+            attr_value_clauses = update_expression_ast.find_clauses(
+                [ExpressionAttributeValue]
+            )
+            expression_attribute_values_used.extend(
+                [attr.get_value_name() for attr in attr_value_clauses]
+            )
 
         else:
             update_expression = ""
-            expression_attribute_names_used = []
 
         return_values_on_condition_check_failure = self.body.get(
             "ReturnValuesOnConditionCheckFailure"
@@ -1082,9 +1091,13 @@ class DynamoHandler(BaseResponse):
         )
         condition_parser.parse()
         expression_attribute_names_used += condition_parser.expr_attr_names_found
-        validate_attribute_names_used(
+        expression_attribute_values_used += condition_parser.expr_attr_values_found
+        validate_attributes_used(
             expression_attribute_names, expression_attribute_names_used
         )
+        validate_attributes_used(
+            expression_attribute_values, expression_attribute_values_used, "Values"
+        )
 
         item = self.dynamodb_backend.update_item(
             name,
@@ -1131,11 +1144,15 @@ class DynamoHandler(BaseResponse):
             return {}
         if len(values) == 0:
             raise ExpressionAttributeValuesEmpty
-        for key in values.keys():
+        for key in values:
             if not key.startswith(":"):
                 raise MockValidationException(
                     f'ExpressionAttributeValues contains invalid key: Syntax error; key: "{key}"'
                 )
+            if values[key] == {"NS": []}:
+                raise MockValidationException(
+                    f"ExpressionAttributeValues contains invalid value: One or more parameter values were invalid: An number set  may not be empty for key {key}"
+                )
         return values
 
     def _build_updated_new_attributes(self, original: Any, changed: Any) -> Any:
@@ -1298,7 +1315,7 @@ class DynamoHandler(BaseResponse):
                     attr.get_attribute_name_placeholder() for attr in attr_name_clauses
                 ]
 
-            validate_attribute_names_used(
+            validate_attributes_used(
                 expression_attribute_names, expression_attribute_names_used
             )
 
diff --git a/moto/ssm/resources/regions.json b/moto/ssm/resources/regions.json
index fb11f57a8..bc0a69765 100644
--- a/moto/ssm/resources/regions.json
+++ b/moto/ssm/resources/regions.json
@@ -1067,13 +1067,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -2835,13 +2829,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -4002,6 +3990,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "lakeformation": {
+                "Value": "lakeformation",
+                "endpoint": {
+                  "Value": "lakeformation.ap-east-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "lambda": {
                 "Value": "lambda",
                 "endpoint": {
@@ -4089,6 +4086,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "redshift-data": {
+                "Value": "redshift-data",
+                "endpoint": {
+                  "Value": "redshift-data.ap-east-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "resource-groups": {
                 "Value": "resource-groups",
                 "endpoint": {
@@ -5983,13 +5989,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -8638,13 +8638,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -8844,6 +8838,12 @@
                   "Value": "HTTPS"
                 }
               },
+              "observabilityadmin": {
+                "Value": "observabilityadmin",
+                "endpoint": {
+                  "Value": "observabilityadmin.ap-northeast-2.amazonaws.com"
+                }
+              },
               "opensearchserverless": {
                 "Value": "opensearchserverless",
                 "endpoint": {
@@ -10788,6 +10788,12 @@
                   "Value": "HTTPS"
                 }
               },
+              "observabilityadmin": {
+                "Value": "observabilityadmin",
+                "endpoint": {
+                  "Value": "observabilityadmin.ap-northeast-3.amazonaws.com"
+                }
+              },
               "opensearchserverless": {
                 "Value": "opensearchserverless",
                 "endpoint": {
@@ -10815,6 +10821,9 @@
                   "Value": "HTTPS"
                 }
               },
+              "payment-cryptography": {
+                "Value": "payment-cryptography"
+              },
               "pca-connector-ad": {
                 "Value": "pca-connector-ad",
                 "endpoint": {
@@ -12787,13 +12796,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -12981,6 +12984,12 @@
                   "Value": "HTTPS"
                 }
               },
+              "observabilityadmin": {
+                "Value": "observabilityadmin",
+                "endpoint": {
+                  "Value": "observabilityadmin.ap-south-1.amazonaws.com"
+                }
+              },
               "opensearchserverless": {
                 "Value": "opensearchserverless",
                 "endpoint": {
@@ -13017,6 +13026,9 @@
                   "Value": "HTTPS"
                 }
               },
+              "payment-cryptography": {
+                "Value": "payment-cryptography"
+              },
               "pca-connector-ad": {
                 "Value": "pca-connector-ad",
                 "endpoint": {
@@ -16856,13 +16868,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -19649,13 +19655,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -21741,13 +21741,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -23851,6 +23845,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "appsync": {
+                "Value": "appsync",
+                "endpoint": {
+                  "Value": "appsync.ap-southeast-5.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "aps": {
                 "Value": "aps",
                 "endpoint": {
@@ -24968,6 +24971,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "appsync": {
+                "Value": "appsync",
+                "endpoint": {
+                  "Value": "appsync.ap-southeast-7.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "aps": {
                 "Value": "aps",
                 "endpoint": {
@@ -27316,13 +27328,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -27516,6 +27522,12 @@
                   "Value": "HTTPS"
                 }
               },
+              "observabilityadmin": {
+                "Value": "observabilityadmin",
+                "endpoint": {
+                  "Value": "observabilityadmin.ca-central-1.amazonaws.com"
+                }
+              },
               "opensearchserverless": {
                 "Value": "opensearchserverless",
                 "endpoint": {
@@ -28497,6 +28509,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "appsync": {
+                "Value": "appsync",
+                "endpoint": {
+                  "Value": "appsync.ca-west-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "arc-zonal-shift": {
                 "Value": "arc-zonal-shift",
                 "endpoint": {
@@ -34134,13 +34155,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -38037,13 +38052,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -43896,13 +43905,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -46699,13 +46702,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -48994,13 +48991,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -50346,6 +50337,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "docdb": {
+                "Value": "docdb",
+                "endpoint": {
+                  "Value": "rds.il-central-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS, HTTP"
+                }
+              },
               "drs": {
                 "Value": "drs",
                 "endpoint": {
@@ -52253,13 +52253,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -53933,13 +53927,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -56839,13 +56827,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -57039,6 +57021,12 @@
                   "Value": "HTTPS"
                 }
               },
+              "observabilityadmin": {
+                "Value": "observabilityadmin",
+                "endpoint": {
+                  "Value": "observabilityadmin.sa-east-1.amazonaws.com"
+                }
+              },
               "opensearchserverless": {
                 "Value": "opensearchserverless",
                 "endpoint": {
@@ -59746,13 +59734,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace",
@@ -62728,13 +62710,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -64787,13 +64763,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -64906,6 +64876,12 @@
                   "Value": "HTTPS"
                 }
               },
+              "pcs": {
+                "Value": "pcs",
+                "endpoint": {
+                  "Value": "pcs.us-gov-east-1.amazonaws.com"
+                }
+              },
               "pi": {
                 "Value": "pi",
                 "endpoint": {
@@ -66525,13 +66501,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -66653,6 +66623,12 @@
                   "Value": "HTTPS"
                 }
               },
+              "pcs": {
+                "Value": "pcs",
+                "endpoint": {
+                  "Value": "pcs.us-gov-west-1.amazonaws.com"
+                }
+              },
               "pi": {
                 "Value": "pi",
                 "endpoint": {
@@ -68425,13 +68401,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace"
@@ -71146,13 +71116,7 @@
                 }
               },
               "managedservices": {
-                "Value": "managedservices",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "managedservices"
               },
               "marketplace": {
                 "Value": "marketplace",
diff --git a/moto/ssm/resources/services.json b/moto/ssm/resources/services.json
index 801b1476c..71a2e0e3c 100644
--- a/moto/ssm/resources/services.json
+++ b/moto/ssm/resources/services.json
@@ -4971,6 +4971,24 @@
                   "Value": "HTTPS"
                 }
               },
+              "ap-southeast-5": {
+                "Value": "ap-southeast-5",
+                "endpoint": {
+                  "Value": "appsync.ap-southeast-5.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
+              "ap-southeast-7": {
+                "Value": "ap-southeast-7",
+                "endpoint": {
+                  "Value": "appsync.ap-southeast-7.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "ca-central-1": {
                 "Value": "ca-central-1",
                 "endpoint": {
@@ -4980,6 +4998,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "ca-west-1": {
+                "Value": "ca-west-1",
+                "endpoint": {
+                  "Value": "appsync.ca-west-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "cn-north-1": {
                 "Value": "cn-north-1",
                 "endpoint": {
@@ -20728,6 +20755,15 @@
                   "Value": "HTTPS, HTTP"
                 }
               },
+              "il-central-1": {
+                "Value": "il-central-1",
+                "endpoint": {
+                  "Value": "rds.il-central-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS, HTTP"
+                }
+              },
               "me-central-1": {
                 "Value": "me-central-1",
                 "endpoint": {
@@ -39414,6 +39450,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "ap-east-2": {
+                "Value": "ap-east-2",
+                "endpoint": {
+                  "Value": "lakeformation.ap-east-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "ap-northeast-1": {
                 "Value": "ap-northeast-1",
                 "endpoint": {
@@ -43090,211 +43135,73 @@
             },
             "regions": {
               "af-south-1": {
-                "Value": "af-south-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "af-south-1"
               },
               "ap-east-1": {
-                "Value": "ap-east-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "ap-east-1"
               },
               "ap-northeast-1": {
-                "Value": "ap-northeast-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "ap-northeast-1"
               },
               "ap-northeast-2": {
-                "Value": "ap-northeast-2",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "ap-northeast-2"
               },
               "ap-south-1": {
-                "Value": "ap-south-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "ap-south-1"
               },
               "ap-southeast-1": {
-                "Value": "ap-southeast-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "ap-southeast-1"
               },
               "ap-southeast-2": {
-                "Value": "ap-southeast-2",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "ap-southeast-2"
               },
               "ap-southeast-3": {
-                "Value": "ap-southeast-3",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "ap-southeast-3"
               },
               "ca-central-1": {
-                "Value": "ca-central-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "ca-central-1"
               },
               "eu-central-1": {
-                "Value": "eu-central-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "eu-central-1"
               },
               "eu-north-1": {
-                "Value": "eu-north-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "eu-north-1"
               },
               "eu-west-1": {
-                "Value": "eu-west-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "eu-west-1"
               },
               "eu-west-2": {
-                "Value": "eu-west-2",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "eu-west-2"
               },
               "eu-west-3": {
-                "Value": "eu-west-3",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "eu-west-3"
               },
               "me-central-1": {
-                "Value": "me-central-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "me-central-1"
               },
               "me-south-1": {
-                "Value": "me-south-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "me-south-1"
               },
               "sa-east-1": {
-                "Value": "sa-east-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "sa-east-1"
               },
               "us-east-1": {
-                "Value": "us-east-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "us-east-1"
               },
               "us-east-2": {
-                "Value": "us-east-2",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "us-east-2"
               },
               "us-gov-east-1": {
-                "Value": "us-gov-east-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "us-gov-east-1"
               },
               "us-gov-west-1": {
-                "Value": "us-gov-west-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "us-gov-west-1"
               },
               "us-west-1": {
-                "Value": "us-west-1",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "us-west-1"
               },
               "us-west-2": {
-                "Value": "us-west-2",
-                "endpoint": {
-                  "Value": "amscm.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
+                "Value": "us-west-2"
               }
             }
           },
@@ -48913,6 +48820,24 @@
                   "Value": "observabilityadmin.ap-northeast-1.amazonaws.com"
                 }
               },
+              "ap-northeast-2": {
+                "Value": "ap-northeast-2",
+                "endpoint": {
+                  "Value": "observabilityadmin.ap-northeast-2.amazonaws.com"
+                }
+              },
+              "ap-northeast-3": {
+                "Value": "ap-northeast-3",
+                "endpoint": {
+                  "Value": "observabilityadmin.ap-northeast-3.amazonaws.com"
+                }
+              },
+              "ap-south-1": {
+                "Value": "ap-south-1",
+                "endpoint": {
+                  "Value": "observabilityadmin.ap-south-1.amazonaws.com"
+                }
+              },
               "ap-southeast-1": {
                 "Value": "ap-southeast-1",
                 "endpoint": {
@@ -48925,6 +48850,12 @@
                   "Value": "observabilityadmin.ap-southeast-2.amazonaws.com"
                 }
               },
+              "ca-central-1": {
+                "Value": "ca-central-1",
+                "endpoint": {
+                  "Value": "observabilityadmin.ca-central-1.amazonaws.com"
+                }
+              },
               "eu-central-1": {
                 "Value": "eu-central-1",
                 "endpoint": {
@@ -48955,6 +48886,12 @@
                   "Value": "observabilityadmin.eu-west-3.amazonaws.com"
                 }
               },
+              "sa-east-1": {
+                "Value": "sa-east-1",
+                "endpoint": {
+                  "Value": "observabilityadmin.sa-east-1.amazonaws.com"
+                }
+              },
               "us-east-1": {
                 "Value": "us-east-1",
                 "endpoint": {
@@ -50253,6 +50190,12 @@
               "ap-northeast-1": {
                 "Value": "ap-northeast-1"
               },
+              "ap-northeast-3": {
+                "Value": "ap-northeast-3"
+              },
+              "ap-south-1": {
+                "Value": "ap-south-1"
+              },
               "ap-southeast-1": {
                 "Value": "ap-southeast-1"
               },
@@ -50895,6 +50838,18 @@
                   "Value": "pcs.us-east-2.amazonaws.com"
                 }
               },
+              "us-gov-east-1": {
+                "Value": "us-gov-east-1",
+                "endpoint": {
+                  "Value": "pcs.us-gov-east-1.amazonaws.com"
+                }
+              },
+              "us-gov-west-1": {
+                "Value": "us-gov-west-1",
+                "endpoint": {
+                  "Value": "pcs.us-gov-west-1.amazonaws.com"
+                }
+              },
               "us-west-2": {
                 "Value": "us-west-2",
                 "endpoint": {
@@ -54737,6 +54692,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "ap-east-2": {
+                "Value": "ap-east-2",
+                "endpoint": {
+                  "Value": "redshift-data.ap-east-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "ap-northeast-1": {
                 "Value": "ap-northeast-1",
                 "endpoint": {


Test patch:
diff --git a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
index 9aa994560..efe24480a 100644
--- a/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
+++ b/tests/test_dynamodb/exceptions/test_dynamodb_exceptions.py
@@ -1,3 +1,4 @@
+from decimal import Decimal
 from unittest import SkipTest
 from uuid import uuid4
 
@@ -451,13 +452,14 @@ class TestUpdateExpressionClausesWithClashingExpressions(BaseTest):
 
 @pytest.mark.aws_verified
 @dynamodb_aws_verified()
-def test_update_item_unused_attribute_name(table_name=None):
+def test_update_item_unused_attributes(table_name=None):
     ddb = boto3.resource("dynamodb", region_name="us-east-1")
 
     # Create the DynamoDB table.
     table = ddb.Table(table_name)
-    table.put_item(Item={"pk": "pk1", "spec": {}, "am": 0})
+    table.put_item(Item={"pk": "pk1", "spec": {}, "am": 0, "test": "text"})
 
+    # Unused Name (count), in addition to Used Name (limit)
     with pytest.raises(ClientError) as exc:
         table.update_item(
             Key={"pk": "pk1"},
@@ -472,6 +474,7 @@ def test_update_item_unused_attribute_name(table_name=None):
         == "Value provided in ExpressionAttributeNames unused in expressions: keys: {#count}"
     )
 
+    # Unused Name (count) only
     with pytest.raises(ClientError) as exc:
         table.update_item(
             Key={"pk": "pk1"},
@@ -486,10 +489,55 @@ def test_update_item_unused_attribute_name(table_name=None):
         == "Value provided in ExpressionAttributeNames unused in expressions: keys: {#count}"
     )
 
+    # Unused Value (countChange)
+    with pytest.raises(ClientError) as exc:
+        table.update_item(
+            Key={"pk": "pk1"},
+            UpdateExpression="SET spec.#limit = :limit",
+            ExpressionAttributeNames={"#limit": "limit"},
+            ExpressionAttributeValues={":countChange": 1, ":limit": "limit"},
+        )
+    err = exc.value.response["Error"]
+    assert err["Code"] == "ValidationException"
+    assert (
+        err["Message"]
+        == "Value provided in ExpressionAttributeValues unused in expressions: keys: {:countChange}"
+    )
+
+    # Used value in ConditionExpression
+    table.update_item(
+        Key={"pk": "pk1"},
+        UpdateExpression="SET spec.#limit = :limit",
+        ConditionExpression="begins_with(test, :t)",
+        ExpressionAttributeNames={"#limit": "limit"},
+        ExpressionAttributeValues={":t": "t", ":limit": "limit"},
+    )
+    item = table.get_item(Key={"pk": "pk1"})["Item"]
+    assert item == {
+        "spec": {"limit": "limit"},
+        "pk": "pk1",
+        "am": Decimal("0"),
+        "test": "text",
+    }
+
+    # Used ExpressionAttributeValue, but with invalid value
+    with pytest.raises(ClientError) as exc:
+        table.update_item(
+            Key={"pk": "pk1"},
+            UpdateExpression="SET x = :one",
+            ExpressionAttributeValues={":one": set()},
+        )
+    err = exc.value.response["Error"]
+    assert err["Code"] == "ValidationException"
+    assert (
+        err["Message"]
+        == "ExpressionAttributeValues contains invalid value: One or more parameter values were invalid: An number set  may not be empty for key :one"
+    )
+
 
 @pytest.mark.aws_verified
 @dynamodb_aws_verified()
-def test_put_item_unused_attribute_name(table_name=None):
+def test_put_item_unused_attributes(table_name=None):
     ddb = boto3.resource("dynamodb", region_name="us-east-1")
 
     table = ddb.Table(table_name)
diff --git a/tests/test_dynamodb/test_dynamodb.py b/tests/test_dynamodb/test_dynamodb.py
index 674c3a55b..f000e5fa6 100644
--- a/tests/test_dynamodb/test_dynamodb.py
+++ b/tests/test_dynamodb/test_dynamodb.py
@@ -4757,7 +4757,7 @@ def test_update_item_with_global_secondary_index():
                 table.update_item(
                     Key={"id": "test1"},
                     UpdateExpression=f"SET {key_name} = :gsi_hash_key",
-                    ExpressionAttributeValues={":gsi_hash_key": v, ":abc": ""},
+                    ExpressionAttributeValues={":gsi_hash_key": v},
                 )
             err = ex.value.response["Error"]
             assert err["Code"] == "ValidationException"