Implementation an AWS Lambda function that can fetch the number of streams an AWS account has within a region in python / Boto3.
It retrieves the list of Kinesis Video Streams using the ListStreams REST API, then iterates through the paginated responses to count the total number of streams.
Provides retry logic for transient errors such as throttling or service limits.
Testing
Lambda: Fetch the stream count when the Lambda execution role is missing kinesisvideo:ListStream permissions.
Lambda: Fetch the stream count, with 0 streams.
Lambda: Fetch the stream count, with > 100,000 streams.
Same manual runs performed on my local computer.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Description of changes:
Testing
Lambda: Fetch the stream count when the Lambda execution role is missing
kinesisvideo:ListStream
permissions.Lambda: Fetch the stream count, with 0 streams.
Lambda: Fetch the stream count, with > 100,000 streams.
Same manual runs performed on my local computer.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.