While a lambda is still processing (archive unpacking etc), the lambda state should be set to "Pending" (currently "Active") and invocations to that lambda should fail (currently, it can end up in a inconsistent state in this case, like lambdas being executed without layers).

Lambda state should reflect the current internal state, and invocations should fail if not active.
def __init__(self, id, params=None, num_shards=1, connection=None):
        super(KinesisStream, self).__init__(id)
        params = params or {}
        self.shards = []
        self.stream_name = params.get("name", self.name())
        self.num_shards = params.get("shards", num_shards)
        self.conn = connection
        self.stream_info = params
    def name(self):
        return self.id.split(":stream/")[-1]
    def connect(self, connection):
        self.conn = connection
    def describe(self):
        r = self.conn.describe_stream(StreamName=self.stream_name)
        return r.get("StreamDescription")
    def create(self, raise_on_error=False):
        try:
            self.conn.create_stream(StreamName=self.stream_name, ShardCount=self.num_shards)
        except Exception as e:
            
            if raise_on_error:
                raise e
    def get_status(self):
        description = self.describe()
        return description.get("StreamStatus")
    def put(self, data, key):
        if not isinstance(data, str):
            data = json.dumps(data)
        return self.conn.put_record(StreamName=self.stream_name, Data=data, PartitionKey=key)
    def read(self, amount=-1, shard="shardId-000000000001"):