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 6089f83
Show file tree
Hide file tree
Showing 2 changed files with 5 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 @@ -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

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
4 changes: 3 additions & 1 deletion moto/ssm/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6089f83

Please sign in to comment.