From 16f9ff56a33857373a0e0c3548889e115600079e Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Fri, 16 Dec 2022 14:53:27 -0100 Subject: [PATCH] Kinesis: Support new endpoint for botocore 1.29.31 (#5778) --- moto/kinesis/urls.py | 3 +++ tests/test_kinesis/test_kinesis_stream_consumers.py | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/moto/kinesis/urls.py b/moto/kinesis/urls.py index cc7dec0b5..94f802859 100644 --- a/moto/kinesis/urls.py +++ b/moto/kinesis/urls.py @@ -3,6 +3,9 @@ from .responses import KinesisResponse url_bases = [ # Need to avoid conflicting with kinesisvideo r"https?://kinesis\.(.+)\.amazonaws\.com", + # Somewhere around boto3-1.26.31 botocore-1.29.31, AWS started using a new endpoint: + # 111122223333.control-kinesis.us-east-1.amazonaws.com + r"https?://(.+)\.control-kinesis\.(.+)\.amazonaws\.com", ] url_paths = {"{0}/$": KinesisResponse.dispatch} diff --git a/tests/test_kinesis/test_kinesis_stream_consumers.py b/tests/test_kinesis/test_kinesis_stream_consumers.py index 7be8d612d..d13ac0229 100644 --- a/tests/test_kinesis/test_kinesis_stream_consumers.py +++ b/tests/test_kinesis/test_kinesis_stream_consumers.py @@ -98,11 +98,14 @@ def test_describe_stream_consumer_unknown(): client = boto3.client("kinesis", region_name="us-east-2") create_stream(client) + unknown_arn = f"arn:aws:kinesis:us-east-2:{ACCOUNT_ID}:stream/unknown" with pytest.raises(ClientError) as exc: - client.describe_stream_consumer(ConsumerARN="unknown") + client.describe_stream_consumer(ConsumerARN=unknown_arn) err = exc.value.response["Error"] err["Code"].should.equal("ResourceNotFoundException") - err["Message"].should.equal(f"Consumer unknown, account {ACCOUNT_ID} not found.") + err["Message"].should.equal( + f"Consumer {unknown_arn}, account {ACCOUNT_ID} not found." + ) @mock_kinesis