diff --git a/moto/elastictranscoder/responses.py b/moto/elastictranscoder/responses.py index 99fc116c6d76..50e7588cc84b 100644 --- a/moto/elastictranscoder/responses.py +++ b/moto/elastictranscoder/responses.py @@ -4,6 +4,7 @@ from moto.core.common_types import TYPE_RESPONSE from moto.core.responses import BaseResponse +from moto.utilities.utils import ARN_PARTITION_REGEX from .models import ElasticTranscoderBackend, elastictranscoder_backends @@ -45,7 +46,7 @@ def create_pipeline(self) -> TYPE_RESPONSE: thumbnail_config = self._get_param("ThumbnailConfig") if not role: return self.err("Role cannot be blank") - if not re.match("^arn:aws:iam::[0-9]+:role/.+", role): + if not re.match(f"{ARN_PARTITION_REGEX}:iam::[0-9]+:role/.+", role): return self.err(f"Role ARN is invalid: {role}") if not output_bucket and not content_config: return self.err( diff --git a/moto/ssm/models.py b/moto/ssm/models.py index bde58b117ba1..9d114696b8c2 100644 --- a/moto/ssm/models.py +++ b/moto/ssm/models.py @@ -1187,7 +1187,9 @@ def __init__(self, region_name: str, account_id: str): self.windows: Dict[str, FakeMaintenanceWindow] = dict() self.baselines: Dict[str, FakePatchBaseline] = dict() - self.ssm_prefix = f"arn:aws:ssm:{self.region_name}:{self.account_id}:parameter" + self.ssm_prefix = ( + f"arn:{self.partition}:ssm:{self.region_name}:{self.account_id}:parameter" + ) def _generate_document_information( self, ssm_document: Document, document_format: str