Repository: getmoto/moto
Pull request #7454 (2024-03-10 12:11:24)

chore: update SSM Instance parameters
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action


Patch:
diff --git a/IMPLEMENTATION_COVERAGE.md b/IMPLEMENTATION_COVERAGE.md
index a36e45472..3e91aaee6 100644
--- a/IMPLEMENTATION_COVERAGE.md
+++ b/IMPLEMENTATION_COVERAGE.md
@@ -6509,7 +6509,7 @@
 
 ## s3
 <details>
-<summary>67% implemented</summary>
+<summary>68% implemented</summary>
 
 - [X] abort_multipart_upload
 - [X] complete_multipart_upload
@@ -6605,7 +6605,7 @@
 - [X] put_object_retention
 - [X] put_object_tagging
 - [X] put_public_access_block
-- [ ] restore_object
+- [X] restore_object
 - [X] select_object_content
 - [X] upload_file
 - [X] upload_fileobj
diff --git a/docs/docs/services/s3.rst b/docs/docs/services/s3.rst
index bcabe4bbc..d7973040d 100644
--- a/docs/docs/services/s3.rst
+++ b/docs/docs/services/s3.rst
@@ -138,7 +138,7 @@ s3
 - [X] put_object_retention
 - [X] put_object_tagging
 - [X] put_public_access_block
-- [ ] restore_object
+- [X] restore_object
 - [X] select_object_content
   
         Highly experimental. Please raise an issue if you find any inconsistencies/bugs.
diff --git a/moto/s3/models.py b/moto/s3/models.py
index 407b60e2a..b96a1581c 100644
--- a/moto/s3/models.py
+++ b/moto/s3/models.py
@@ -42,6 +42,7 @@ from moto.s3.exceptions import (
     InvalidBucketName,
     InvalidNotificationDestination,
     InvalidNotificationEvent,
+    InvalidObjectState,
     InvalidPart,
     InvalidPublicAccessBlockConfiguration,
     InvalidRequest,
@@ -197,6 +198,25 @@ class FakeKey(BaseModel, ManagedState):
         self._value_buffer.write(new_value)
         self.contentsize = len(new_value)
 
+    @property
+    def status(self) -> Optional[str]:
+        previous = self._status
+        new_status = super().status
+        if previous != "RESTORED" and new_status == "RESTORED":
+            s3_backend = s3_backends[self.account_id]["global"]
+            bucket = s3_backend.get_bucket(self.bucket_name)  # type: ignore
+            notifications.send_event(
+                self.account_id,
+                notifications.S3NotificationEvent.OBJECT_RESTORE_COMPLETED_EVENT,
+                bucket,
+                key=self,
+            )
+        return new_status
+
+    @status.setter
+    def status(self, value: str) -> None:
+        self._status = value
+
     def set_metadata(self, metadata: Any, replace: bool = False) -> None:
         if replace:
             self._metadata = {}  # type: ignore
@@ -215,6 +235,14 @@ class FakeKey(BaseModel, ManagedState):
 
     def restore(self, days: int) -> None:
         self._expiry = utcnow() + datetime.timedelta(days)
+        s3_backend = s3_backends[self.account_id]["global"]
+        bucket = s3_backend.get_bucket(self.bucket_name)  # type: ignore
+        notifications.send_event(
+            self.account_id,
+            notifications.S3NotificationEvent.OBJECT_RESTORE_POST_EVENT,
+            bucket,
+            key=self,
+        )
 
     @property
     def etag(self) -> str:
@@ -2854,6 +2882,16 @@ class S3Backend(BaseBackend, CloudWatchMetricProvider):
             for x in query_result
         ]
 
+    def restore_object(self, bucket_name: str, key_name: str, days: str) -> bool:
+        key = self.get_object(bucket_name, key_name)
+        if not key:
+            raise MissingKey
+        if key.storage_class not in ARCHIVE_STORAGE_CLASSES:
+            raise InvalidObjectState(storage_class=key.storage_class)
+        had_expiry_date = key.expiry_date is not None
+        key.restore(int(days))
+        return had_expiry_date
+
     def upload_file(self) -> None:
         # Listed for the implementation coverage
         # Implementation part of responses.py
diff --git a/moto/s3/responses.py b/moto/s3/responses.py
index 629df1c4e..a737f74df 100644
--- a/moto/s3/responses.py
+++ b/moto/s3/responses.py
@@ -2274,14 +2274,11 @@ class S3Response(BaseResponse):
         elif "restore" in query:
             es = minidom.parseString(body).getElementsByTagName("Days")
             days = es[0].childNodes[0].wholeText
-            key = self.backend.get_object(bucket_name, key_name)  # type: ignore
-            if key.storage_class not in ARCHIVE_STORAGE_CLASSES:  # type: ignore
-                raise InvalidObjectState(storage_class=key.storage_class)  # type: ignore
-            r = 202
-            if key.expiry_date is not None:  # type: ignore
-                r = 200
-            key.restore(int(days))  # type: ignore
-            return r, {}, ""
+            previously_restored = self.backend.restore_object(
+                bucket_name, key_name, days
+            )
+            status_code = 200 if previously_restored else 202
+            return status_code, {}, ""
         elif "select" in query:
             request = xmltodict.parse(body)["SelectObjectContentRequest"]
             select_query = request["Expression"]
diff --git a/moto/ssm/resources/regions.json b/moto/ssm/resources/regions.json
index 71a0651c2..310b48e7b 100644
--- a/moto/ssm/resources/regions.json
+++ b/moto/ssm/resources/regions.json
@@ -1531,15 +1531,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -3173,15 +3164,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -5796,15 +5778,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -8199,15 +8172,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -9825,15 +9789,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -12042,15 +11997,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -12814,6 +12760,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "identitystore": {
+                "Value": "identitystore",
+                "endpoint": {
+                  "Value": "identitystore.ap-south-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "imagebuilder": {
                 "Value": "imagebuilder",
                 "endpoint": {
@@ -13303,15 +13258,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -15811,15 +15757,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -18514,15 +18451,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -20018,15 +19946,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -21231,15 +21150,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -22255,7 +22165,7 @@
                   "Value": "iot.ca-central-1.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               },
               "fsx": {
@@ -23467,15 +23377,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -24079,6 +23980,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "guardduty": {
+                "Value": "guardduty",
+                "endpoint": {
+                  "Value": "guardduty.ca-west-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "iam": {
                 "Value": "iam",
                 "endpoint": {
@@ -24115,6 +24025,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "lakeformation": {
+                "Value": "lakeformation",
+                "endpoint": {
+                  "Value": "lakeformation.ca-west-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "lambda": {
                 "Value": "lambda",
                 "endpoint": {
@@ -24409,15 +24328,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -29799,15 +29709,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -31146,15 +31047,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -33136,15 +33028,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -34742,15 +34625,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -35301,6 +35175,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "emr-containers": {
+                "Value": "emr-containers",
+                "endpoint": {
+                  "Value": "emr-containers.eu-south-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "emr-serverless": {
                 "Value": "emr-serverless",
                 "endpoint": {
@@ -35430,6 +35313,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "identitystore": {
+                "Value": "identitystore",
+                "endpoint": {
+                  "Value": "identitystore.eu-south-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "imagebuilder": {
                 "Value": "imagebuilder",
                 "endpoint": {
@@ -35940,15 +35832,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -41123,15 +41006,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -43163,15 +43037,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -44472,15 +44337,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -44884,6 +44740,24 @@
                   "Value": "HTTPS"
                 }
               },
+              "cognito-identity": {
+                "Value": "cognito-identity",
+                "endpoint": {
+                  "Value": "cognito-identity.me-central-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
+              "cognito-idp": {
+                "Value": "cognito-idp",
+                "endpoint": {
+                  "Value": "cognito-idp.me-central-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "compute-optimizer": {
                 "Value": "compute-optimizer",
                 "endpoint": {
@@ -45808,15 +45682,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -47441,15 +47306,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -49404,15 +49260,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -50829,7 +50676,7 @@
                   "Value": "iot.us-east-1.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               },
               "fsx": {
@@ -53781,7 +53628,7 @@
                   "Value": "iot.us-east-2.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               },
               "fsx": {
@@ -55134,15 +54981,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -56587,15 +56425,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-gov-west-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -59184,7 +59013,7 @@
                   "Value": "iot.us-west-1.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               },
               "fsx": {
@@ -60267,15 +60096,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "support": {
-                "Value": "support",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "swf": {
                 "Value": "swf",
                 "endpoint": {
@@ -61605,7 +61425,7 @@
                   "Value": "iot.us-west-2.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               },
               "fsx": {
diff --git a/moto/ssm/resources/services.json b/moto/ssm/resources/services.json
index c09d89519..5235d9592 100644
--- a/moto/ssm/resources/services.json
+++ b/moto/ssm/resources/services.json
@@ -13560,6 +13560,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "me-central-1": {
+                "Value": "me-central-1",
+                "endpoint": {
+                  "Value": "cognito-identity.me-central-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "me-south-1": {
                 "Value": "me-south-1",
                 "endpoint": {
@@ -13775,6 +13784,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "me-central-1": {
+                "Value": "me-central-1",
+                "endpoint": {
+                  "Value": "cognito-idp.me-central-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "me-south-1": {
                 "Value": "me-south-1",
                 "endpoint": {
@@ -23031,6 +23049,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "eu-south-2": {
+                "Value": "eu-south-2",
+                "endpoint": {
+                  "Value": "emr-containers.eu-south-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "eu-west-1": {
                 "Value": "eu-west-1",
                 "endpoint": {
@@ -26026,7 +26053,7 @@
                   "Value": "iot.ca-central-1.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               },
               "cn-north-1": {
@@ -26116,7 +26143,7 @@
                   "Value": "iot.us-east-1.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               },
               "us-east-2": {
@@ -26125,7 +26152,7 @@
                   "Value": "iot.us-east-2.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               },
               "us-west-1": {
@@ -26134,7 +26161,7 @@
                   "Value": "iot.us-west-1.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               },
               "us-west-2": {
@@ -26143,7 +26170,7 @@
                   "Value": "iot.us-west-2.amazonaws.com"
                 },
                 "protocols": {
-                  "Value": "HTTPS"
+                  "Value": "https"
                 }
               }
             }
@@ -29052,6 +29079,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "ca-west-1": {
+                "Value": "ca-west-1",
+                "endpoint": {
+                  "Value": "guardduty.ca-west-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "cn-north-1": {
                 "Value": "cn-north-1",
                 "endpoint": {
@@ -29947,6 +29983,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "ap-south-2": {
+                "Value": "ap-south-2",
+                "endpoint": {
+                  "Value": "identitystore.ap-south-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "ap-southeast-1": {
                 "Value": "ap-southeast-1",
                 "endpoint": {
@@ -30046,6 +30091,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "eu-south-2": {
+                "Value": "eu-south-2",
+                "endpoint": {
+                  "Value": "identitystore.eu-south-2.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "eu-west-1": {
                 "Value": "eu-west-1",
                 "endpoint": {
@@ -35676,6 +35730,15 @@
                   "Value": "HTTPS"
                 }
               },
+              "ca-west-1": {
+                "Value": "ca-west-1",
+                "endpoint": {
+                  "Value": "lakeformation.ca-west-1.amazonaws.com"
+                },
+                "protocols": {
+                  "Value": "HTTPS"
+                }
+              },
               "cn-north-1": {
                 "Value": "cn-north-1",
                 "endpoint": {
@@ -60754,123 +60817,6 @@
               "Value": "https://aws.amazon.com/premiumsupport/"
             },
             "regions": {
-              "af-south-1": {
-                "Value": "af-south-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-east-1": {
-                "Value": "ap-east-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-northeast-1": {
-                "Value": "ap-northeast-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-northeast-2": {
-                "Value": "ap-northeast-2",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-northeast-3": {
-                "Value": "ap-northeast-3",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-south-1": {
-                "Value": "ap-south-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-south-2": {
-                "Value": "ap-south-2",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-southeast-1": {
-                "Value": "ap-southeast-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-southeast-2": {
-                "Value": "ap-southeast-2",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-southeast-3": {
-                "Value": "ap-southeast-3",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ap-southeast-4": {
-                "Value": "ap-southeast-4",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ca-central-1": {
-                "Value": "ca-central-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "ca-west-1": {
-                "Value": "ca-west-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "cn-north-1": {
                 "Value": "cn-north-1",
                 "endpoint": {
@@ -60889,51 +60835,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "eu-central-1": {
-                "Value": "eu-central-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "eu-central-2": {
-                "Value": "eu-central-2",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "eu-north-1": {
-                "Value": "eu-north-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "eu-south-1": {
-                "Value": "eu-south-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "eu-south-2": {
-                "Value": "eu-south-2",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "eu-west-1": {
                 "Value": "eu-west-1",
                 "endpoint": {
@@ -60943,60 +60844,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "eu-west-2": {
-                "Value": "eu-west-2",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "eu-west-3": {
-                "Value": "eu-west-3",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "il-central-1": {
-                "Value": "il-central-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "me-central-1": {
-                "Value": "me-central-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "me-south-1": {
-                "Value": "me-south-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "sa-east-1": {
-                "Value": "sa-east-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "us-east-1": {
                 "Value": "us-east-1",
                 "endpoint": {
@@ -61006,24 +60853,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "us-east-2": {
-                "Value": "us-east-2",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
-              "us-gov-east-1": {
-                "Value": "us-gov-east-1",
-                "endpoint": {
-                  "Value": "support.us-gov-west-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "us-gov-west-1": {
                 "Value": "us-gov-west-1",
                 "endpoint": {
@@ -61033,15 +60862,6 @@
                   "Value": "HTTPS"
                 }
               },
-              "us-west-1": {
-                "Value": "us-west-1",
-                "endpoint": {
-                  "Value": "support.us-east-1.amazonaws.com"
-                },
-                "protocols": {
-                  "Value": "HTTPS"
-                }
-              },
               "us-west-2": {
                 "Value": "us-west-2",
                 "endpoint": {


Test patch:
diff --git a/tests/test_s3/test_s3.py b/tests/test_s3/test_s3.py
index 40a9425b3..cbb5c1d16 100644
--- a/tests/test_s3/test_s3.py
+++ b/tests/test_s3/test_s3.py
@@ -544,7 +544,8 @@ def test_restore_key():
 
     key = bucket.put_object(Key="the-key", Body=b"somedata", StorageClass="GLACIER")
     assert key.restore is None
-    key.restore_object(RestoreRequest={"Days": 1})
+    resp = key.restore_object(RestoreRequest={"Days": 1})
+    assert resp["ResponseMetadata"]["HTTPStatusCode"] == 202
     if settings.TEST_SERVER_MODE:
         assert 'ongoing-request="false"' in key.restore
     elif settings.TEST_DECORATOR_MODE:
@@ -552,7 +553,8 @@ def test_restore_key():
             'ongoing-request="false", expiry-date="Mon, 02 Jan 2012 12:00:00 GMT"'
         )
 
-    key.restore_object(RestoreRequest={"Days": 2})
+    resp = key.restore_object(RestoreRequest={"Days": 2})
+    assert resp["ResponseMetadata"]["HTTPStatusCode"] == 200
 
     if settings.TEST_SERVER_MODE:
         assert 'ongoing-request="false"' in key.restore
@@ -594,6 +596,19 @@ def test_restore_key_transition():
     state_manager.unset_transition(model_name="s3::keyrestore")
 
 
+@mock_aws
+def test_restore_unknown_key():
+    client = boto3.client("s3", region_name=DEFAULT_REGION_NAME)
+    client.create_bucket(Bucket="mybucket")
+
+    with pytest.raises(ClientError) as exc:
+        client.restore_object(
+            Bucket="mybucket", Key="unknown", RestoreRequest={"Days": 1}
+        )
+    err = exc.value.response["Error"]
+    assert err["Code"] == "NoSuchKey"
+
+
 @mock_aws
 def test_cannot_restore_standard_class_object():
     s3_resource = boto3.resource("s3", region_name=DEFAULT_REGION_NAME)
diff --git a/tests/test_s3/test_s3_eventbridge_integration.py b/tests/test_s3/test_s3_eventbridge_integration.py
index 9ccb25cbb..8bd9dc815 100644
--- a/tests/test_s3/test_s3_eventbridge_integration.py
+++ b/tests/test_s3/test_s3_eventbridge_integration.py
@@ -220,3 +220,33 @@ def test_delete_object_notification():
     assert event_message["region"] == REGION_NAME
     assert event_message["detail"]["bucket"]["name"] == bucket_name
     assert event_message["detail"]["reason"] == "ObjectRemoved"
+
+
+@mock_aws
+def test_restore_key_notifications():
+    resource_names = _seteup_bucket_notification_eventbridge()
+    bucket_name = resource_names["bucket_name"]
+
+    s3_resource = boto3.resource("s3", region_name=REGION_NAME)
+
+    bucket = s3_resource.Bucket(bucket_name)
+    key = bucket.put_object(Key="the-key", Body=b"somedata", StorageClass="GLACIER")
+    key.restore_object(RestoreRequest={"Days": 1})
+
+    events = _get_send_events()
+    event_names = [json.loads(e["message"])["detail"]["reason"] for e in events]
+    assert event_names == ["ObjectCreated", "ObjectRestore"]
+
+    # Finish the Object Restoration - restore Completes immediately by default
+    key.load()
+
+    events = _get_send_events()
+    event_names = [json.loads(e["message"])["detail"]["reason"] for e in events]
+    assert event_names == ["ObjectCreated", "ObjectRestore", "ObjectRestore"]
+
+    # Sanity check - loading the Key does not mean the Restore-event is fired every time
+    key.load()
+
+    events = _get_send_events()
+    event_names = [json.loads(e["message"])["detail"]["reason"] for e in events]
+    assert event_names == ["ObjectCreated", "ObjectRestore", "ObjectRestore"]
diff --git a/tests/test_s3/test_s3_storageclass.py b/tests/test_s3/test_s3_storageclass.py
index b680c713d..f2c202373 100644
--- a/tests/test_s3/test_s3_storageclass.py
+++ b/tests/test_s3/test_s3_storageclass.py
@@ -203,9 +203,10 @@ def test_s3_copy_object_for_glacier_storage_class_restored():
     )
 
     s3_client.create_bucket(Bucket="Bucket2")
-    s3_client.restore_object(
+    resp = s3_client.restore_object(
         Bucket="Bucket", Key="First_Object", RestoreRequest={"Days": 123}
     )
+    assert resp["ResponseMetadata"]["HTTPStatusCode"] == 202
 
     s3_client.copy_object(
         CopySource={"Bucket": "Bucket", "Key": "First_Object"},
@@ -241,9 +242,10 @@ def test_s3_copy_object_for_deep_archive_storage_class_restored():
     assert err["StorageClass"] == "DEEP_ARCHIVE"
 
     s3_client.create_bucket(Bucket="Bucket2")
-    s3_client.restore_object(
+    resp = s3_client.restore_object(
         Bucket="Bucket", Key="First_Object", RestoreRequest={"Days": 123}
     )
+    assert resp["ResponseMetadata"]["HTTPStatusCode"] == 202
     s3_client.get_object(Bucket="Bucket", Key="First_Object")
 
     s3_client.copy_object(