diff --git a/moto/core/responses.py b/moto/core/responses.py index 5fda815e7..e0b2e9a5b 100644 --- a/moto/core/responses.py +++ b/moto/core/responses.py @@ -142,7 +142,7 @@ class BaseResponse(_TemplateEnvironmentMixin): # Headers are case-insensitive. Probably a better way to do this. match = self.headers.get('x-amz-target') or self.headers.get('X-Amz-Target') if match: - action = match.split(".")[1] + action = match.split(".")[-1] action = camelcase_to_underscores(action) method_names = method_names_from_class(self.__class__)