diff --git a/moto/sts/responses.py b/moto/sts/responses.py
index 85a0c34e730e..40f8d4f72783 100644
--- a/moto/sts/responses.py
+++ b/moto/sts/responses.py
@@ -40,7 +40,7 @@ def get_federation_token(self) -> str:
name = self.querystring.get("Name")[0] # type: ignore
token = self.backend.get_federation_token(duration=duration, name=name)
template = self.response_template(GET_FEDERATION_TOKEN_RESPONSE)
- return template.render(token=token, account_id=self.current_account)
+ return template.render(token=token, account_id=self.current_account, partition=self.partition)
def assume_role(self) -> str:
role_session_name = self.querystring.get("RoleSessionName")[0] # type: ignore
@@ -128,7 +128,7 @@ def get_caller_identity(self) -> str:
AKIAIOSFODNN7EXAMPLE
- arn:aws:sts::{{ account_id }}:federated-user/{{ token.name }}
+ arn:{{ partition }}:sts::{{ account_id }}:federated-user/{{ token.name }}
{{ account_id }}:{{ token.name }}
6