{"record":{"id":"4210a7b8961ffb7b","repo":"BoundaryML/baml","slug":"invalid-client-property-should-have-been-a-aws-bedrock","errorCode":null,"errorMessage":"Invalid client property. Should have been a aws-bedrock property but got: {}","messagePattern":"Invalid client property\\. Should have been a aws-bedrock property but got: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/internal/llm_client/primitive/aws/aws_client.rs","lineNumber":189,"sourceCode":"\nfn resolve_properties(\n    provider: &ClientProvider,\n    properties: &UnresolvedClientProperty<()>,\n    ctx: &RuntimeContext,\n) -> Result<ResolvedAwsBedrock> {\n    let strict = {\n        #[cfg(target_arch = \"wasm32\")]\n        {\n            false\n        }\n\n        #[cfg(not(target_arch = \"wasm32\"))]\n        true\n    };\n    let properties = properties.resolve(provider, &ctx.eval_ctx(strict))?;\n\n    let ResolvedClientProperty::AWSBedrock(props) = properties else {\n        anyhow::bail!(\n            \"Invalid client property. Should have been a aws-bedrock property but got: {}\",\n            properties.name()\n        );\n    };\n\n    Ok(props)\n}\n\n// Helper function to convert serde_json::Value to aws_smithy_types::Document\nfn serde_json_to_aws_document(value: serde_json::Value) -> Document {\n    match value {\n        serde_json::Value::Null => Document::Null,\n        serde_json::Value::Bool(b) => Document::Bool(b),\n        serde_json::Value::Number(n) => {\n            if n.is_i64() {\n                Document::Number(aws_smithy_types::Number::NegInt(n.as_i64().unwrap()))\n            } else if n.is_u64() {\n                Document::Number(aws_smithy_types::Number::PosInt(n.as_u64().unwrap()))","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/internal/llm_client/primitive/aws/aws_client.rs#L171-L207","documentation":"resolve_properties resolves the client's property block against the runtime context and expects the result to be the AWSBedrock variant. If the resolved properties are any other client type (the provider string didn't map to aws-bedrock, or the wrong properties block was matched), it bails. This is an internal consistency check between the configured provider and the resolved property enum.","triggerScenarios":"Constructing an AwsClient (via dynamic_new or new) whose resolved provider/properties are not aws-bedrock — e.g. a client named/typed as another provider being routed through the AWS client constructor, or a BAML client-define whose provider suffix mis-resolves after client options overrides.","commonSituations":"Programmatically building clients with ClientRegistry where the provider string is misspelled or options override the provider; using a generic 'aws' provider value instead of aws-bedrock; mixing client definitions in multi-provider setups.","solutions":["Set the client's provider to exactly 'aws-bedrock' in the BAML client definition or ClientRegistry.","Check that client options overrides (set_client_options / registry) are not swapping the provider type for this client name.","Log properties.name() from the error message to see which property type actually resolved, and fix the mismatched definition."],"exampleFix":"// before\nclient<llm> Bedrock {\n  provider \"aws\"\n  options { ... }\n}\n// after\nclient<llm> Bedrock {\n  provider \"aws-bedrock\"\n  options { ... }\n}","handlingStrategy":"validation","validationCode":"# verify provider before constructing the client\nif client_registry.provider(client_name) != 'aws-bedrock':\n    raise ValueError(f\"client {client_name} must use provider aws-bedrock\")","typeGuard":null,"tryCatchPattern":"match AwsClient::new(...) {\n    Err(e) if e.to_string().contains(\"Should have been a aws-bedrock property\") => {\n        // fix provider in client definition / registry and retry\n    }\n    other => other?,\n}","preventionTips":["Use the exact provider string 'aws-bedrock' in client definitions","Avoid overriding provider via dynamic client options unless intentional","Keep one client definition per provider to prevent mismatches"],"tags":["aws","bedrock","config","client","internal"],"backgroundTag":"invalid-config-value","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}