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.
region.lambdas[arn].versions = {
            "$LATEST": {
                "CodeSize": self.CODE_SIZE,
                "CodeSha256": self.CODE_SHA_256,
                "RevisionId": self.REVISION_ID,
            }
        }
        region.lambdas[arn].handler = self.HANDLER
        region.lambdas[arn].runtime = self.RUNTIME
        region.lambdas[arn].timeout = self.TIMEOUT
        region.lambdas[arn].tags = tags
        region.lambdas[arn].envvars = {}
        region.lambdas[arn].last_modified = self.LAST_MODIFIED
        region.lambdas[arn].role = self.ROLE
        region.lambdas[arn].memory_size = self.MEMORY_SIZE
    def _update_function_code(self, function_name, tags=None):
        if tags is None:
            tags = {}
        region = lambda_api.LambdaRegion.get()
        arn = lambda_api.func_arn(function_name)
        region.lambdas[arn].versions.update(
            {
                "$LATEST": {
                    "CodeSize": self.CODE_SIZE,
                    "CodeSha256": self.UPDATED_CODE_SHA_256,
                    "RevisionId": self.REVISION_ID,
                }
            }
        )
    def _assert_contained(self, child, parent):