{"record":{"id":"9776b89569269772","repo":"BerriAI/litellm","slug":"aws-region-not-set-set-aws-region-name-or-aws-reg","errorCode":null,"errorMessage":"AWS region not set: set AWS_REGION_NAME or AWS_REGION env variable or in .env file","messagePattern":"AWS region not set: set AWS_REGION_NAME or AWS_REGION env variable or in \\.env file","errorType":"validation","errorClass":"BedrockError","httpStatus":401,"severity":"error","filePath":"litellm/llms/bedrock/common_utils.py","lineNumber":446,"sourceCode":"        aws_session_name,\n        aws_profile_name,\n        aws_role_name,\n        aws_web_identity_token,\n    ) = params_to_check\n\n    ssl_verify: Final = _get_bedrock_client_ssl_verify()\n\n    ### SET REGION NAME\n    if region_name:\n        pass\n    elif aws_region_name:\n        region_name = aws_region_name\n    elif litellm_aws_region_name:\n        region_name = litellm_aws_region_name\n    elif standard_aws_region_name:\n        region_name = standard_aws_region_name\n    else:\n        raise BedrockError(\n            message=\"AWS region not set: set AWS_REGION_NAME or AWS_REGION env variable or in .env file\",\n            status_code=401,\n        )\n\n    # check for custom AWS_BEDROCK_RUNTIME_ENDPOINT and use it if not passed to init_bedrock_client\n    env_aws_bedrock_runtime_endpoint: Final = get_secret(\"AWS_BEDROCK_RUNTIME_ENDPOINT\")\n    if aws_bedrock_runtime_endpoint:\n        endpoint_url = aws_bedrock_runtime_endpoint\n    elif env_aws_bedrock_runtime_endpoint:\n        endpoint_url = env_aws_bedrock_runtime_endpoint\n    else:\n        endpoint_url = f\"https://bedrock-runtime.{region_name}.amazonaws.com\"\n\n    import boto3\n\n    if isinstance(timeout, float):\n        config = boto3.session.Config(connect_timeout=timeout, read_timeout=timeout)\n    elif isinstance(timeout, httpx.Timeout):","sourceCodeStart":428,"sourceCodeEnd":464,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/bedrock/common_utils.py#L428-L464","documentation":"Configuration guard during Bedrock client construction: no AWS region could be resolved from any source (explicit region_name, aws_region_name, litellm params, or AWS_REGION_NAME/AWS_REGION env vars), so the bedrock-runtime endpoint URL cannot be determined.","triggerScenarios":"Thrown at litellm/llms/bedrock/common_utils.py:446 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AWS_REGION_NAME or AWS_REGION environment variable.","Add the region to the .env file used by the proxy.","Pass aws_region_name in litellm_params."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}