Skip to content

Commit

Permalink
Pinpoint: Fix region in application ARN (#8233)
Browse files Browse the repository at this point in the history
  • Loading branch information
viren-nadkarni authored Oct 16, 2024
1 parent 9dbd017 commit 035586c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion moto/pinpoint/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class App(BaseModel):
def __init__(self, account_id: str, region_name: str, name: str):
self.application_id = str(mock_random.uuid4()).replace("-", "")
self.arn = f"arn:{get_partition(region_name)}:mobiletargeting:us-east-1:{account_id}:apps/{self.application_id}"
self.arn = f"arn:{get_partition(region_name)}:mobiletargeting:{region_name}:{account_id}:apps/{self.application_id}"
self.name = name
self.created = unix_time()
self.settings = AppSettings()
Expand Down
2 changes: 2 additions & 0 deletions tests/test_pinpoint/test_pinpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def test_create_app():

assert "ApplicationResponse" in resp
assert "Arn" in resp["ApplicationResponse"]
assert "us-east-1" in resp["ApplicationResponse"]["Arn"]
assert "Id" in resp["ApplicationResponse"]
assert resp["ApplicationResponse"]["Name"] == "myfirstapp"
assert "CreationDate" in resp["ApplicationResponse"]
Expand Down Expand Up @@ -50,6 +51,7 @@ def test_get_app():

assert "ApplicationResponse" in resp
assert "Arn" in resp["ApplicationResponse"]
assert "eu-west-1" in resp["ApplicationResponse"]["Arn"]
assert "Id" in resp["ApplicationResponse"]
assert resp["ApplicationResponse"]["Name"] == "myfirstapp"
assert "CreationDate" in resp["ApplicationResponse"]
Expand Down

0 comments on commit 035586c

Please sign in to comment.