Kinesis: Support new endpoint for botocore 1.29.31 (#5778)

This commit is contained in:
Bert Blommers 2022-12-16 14:53:27 -01:00 committed by GitHub
parent 07a8d6f009
commit 16f9ff56a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -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}

View File

@ -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