
Authenticate an Amazon Bedrock AgentCore Runtime agent with Amazon Cognito and enforce per-tenant data isolation using Amazon Bedrock AgentCore Identity JWT authorization.
cognito:groups claim and gives the model one Amazon DynamoDB tool bound to that tenant. The tool queries a single table partitioned by tenant_id.git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/agentcore-identity-cognito-multi-tenant/python/cdkpython3 -m venv .venvsource .venv/bin/activatepip3 install -r requirements.txtexport CDK_DEFAULT_REGION=us-west-2cdk deploycd test && ./seed_tenant_data.sh <TenantTableName> us-west-2./get_token.shexport AGENT_ARN=<AgentRuntimeArn> && export BEARER_TOKEN=<token> && python test_multi_tenant.py "List my orders"cdk destroy