Skip to content

Commit

Permalink
Fix SSM ARN generation and elastictranscoder arn acceptance
Browse files Browse the repository at this point in the history
  • Loading branch information
dfangl committed Aug 9, 2024
1 parent 560d556 commit 4526a43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion moto/elastictranscoder/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from moto.core.responses import BaseResponse

from .models import ElasticTranscoderBackend, elastictranscoder_backends
from ..utilities.utils import ARN_PARTITION_REGEX


class ElasticTranscoderResponse(BaseResponse):
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion moto/ssm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ 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
Expand Down

0 comments on commit 4526a43

Please sign in to comment.