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.
Timeout=10,
            )
        e.match(
            r"An error occurred \(InvalidParameterValueException\) when calling the CreateFunction operation\: Unzipped size must be smaller than [0-9]* bytes"
        )
    @pytest.mark.aws_validated
    def test_large_lambda(self, lambda_client, s3_client, s3_bucket, lambda_su_role):
        function_name = f"test_lambda_{short_uid()}"
        bucket_key = "test_lambda.zip"
        code_str = generate_sized_python_str(FUNCTION_MAX_UNZIPPED_SIZE - 1000)
        
        zip_file = testutil.create_lambda_archive(
            code_str, get_content=True, runtime=LAMBDA_RUNTIME_PYTHON37
        )
        s3_client.upload_fileobj(BytesIO(zip_file), s3_bucket, bucket_key)
        
        try:
            result = lambda_client.create_function(
                FunctionName=function_name,
                Runtime=LAMBDA_RUNTIME_PYTHON37,
                Handler=LAMBDA_DEFAULT_HANDLER,
                Role=lambda_su_role,
                Code={"S3Bucket": s3_bucket, "S3Key": bucket_key},
                Timeout=10,
            )
            function_arn = result["FunctionArn"]
            assert testutil.response_arn_matches_partition(lambda_client, function_arn)
        finally:
            lambda_client.delete_function(FunctionName=function_name)