fix(bedrockagentcore): relax allowlistedHeaders pattern to match CFN schema (#37969)
### Issue # (if applicable)
Closes #37964.
### Reason for this change
The `validateRequestHeaderConfiguration` method uses an outdated regex that only allows `Authorization` and `X-Amzn-Bedrock-AgentCore-Runtime-Custom-*` headers. The CloudFormation schema for `AWS::BedrockAgentCore::Runtime` has been updated and deployed to all regions to accept `^[A-Za-z][A-Za-z0-9_-]{0,255}$` (any valid HTTP header name).
This causes `cdk synth` to throw `InvalidRequestHeaderConfiguration` for valid headers that the service fully supports. Customers must use a CFN escape hatch to work around this.
### Description of changes
Updated the regex in `validateRequestHeaderConfiguration` from `/(Authorization|X-Amzn-Bedrock-AgentCore-Runtime-Custom-[a-zA-Z0-9-]+)/` to `/^[A-Za-z][A-Za-z0-9_-]{0,255}$/` in the stable module:
- **`aws-cdk-lib/aws-bedrockagentcore`** — `lib/runtime/runtime.ts`
The alpha module (`@aws-cdk/aws-bedrock-agentcore-alpha`) is deprecated and was not modified per maintainer guidance.
Policy enforcement (blocking restricted headers) is handled server-side in the control plane — the CDK construct only needs format validation.
### Describe any new or updated permissions being added
N/A — no IAM permission changes.
### Description of how you validated changes
- Added unit tests to the existing `Runtime request header configuration tests` block:
- Headers beyond the old `X-Amzn-Bedrock-AgentCore-Runtime-Custom-` prefix (should pass)
- Headers with invalid characters like spaces (should fail)
- Headers starting with a number (should fail)
- Headers with underscores (should pass)
- Added integration test with snapshot in the stable module location (`@aws-cdk-testing/framework-integ/test/aws-bedrockagentcore/test/agentcore/runtime/`)
- All 135 unit tests pass locally
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* I
Ivan Eduardo Rivera committed
e0d6c8a2cdd8d2cf5731eb511d93bbd16bbf2291
Parent: bddcd44
Committed by GitHub <noreply@github.com>
on 5/29/2026, 12:38:29 PM