# MetadataConfiguration

Configuration for passing metadata (headers and query parameters) to the API Gateway target.

- Source: [`aws-bedrockagentcore/lib/gateway/targets/target-configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/gateway/targets/target-configuration.ts#L514)
- Type last changed: v2.255.0 · 19 May 2026

## Example

```ts
const gateway = new agentcore.Gateway(this, "MyGateway", {
  gatewayName: "my-gateway",
});

const api = new apigateway.RestApi(this, 'MyApi', {
  restApiName: 'my-api',
});

// Create a gateway target using the static factory method
const apiGatewayTarget = agentcore.GatewayTarget.forApiGateway(this, "MyApiGatewayTarget", {
  gatewayTargetName: "my-api-gateway-target",
  description: "Target for API Gateway REST API integration",
  gateway: gateway,
  restApi: api,
  apiGatewayToolConfiguration: {
    toolFilters: [
      {
        filterPath: "/pets/*",
        methods: [agentcore.ApiGatewayHttpMethod.GET, agentcore.ApiGatewayHttpMethod.POST],
      },
    ],
  },
  metadataConfiguration: {
    allowedRequestHeaders: ["X-User-Id"],
    allowedQueryParameters: ["limit"],
  },
});
```

## Properties

- `allowedQueryParameters`: string[] — List of query parameter names to pass through to the target.

  **Default:** No query parameters are passed through

  Constraints:
  - Array must contain 1-10 items
  - Each parameter name must be 1-40 characters
  - Cannot be an empty array

- `allowedRequestHeaders`: string[] — List of request header names to pass through to the target.

  **Default:** No request headers are passed through

  Constraints:
  - Array must contain 1-10 items
  - Each header name must be 1-100 characters
  - Cannot be an empty array

- `allowedResponseHeaders`: string[] — List of response header names to pass through from the target.

  **Default:** No response headers are passed through

  Constraints:
  - Array must contain 1-10 items
  - Each header name must be 1-100 characters
  - Cannot be an empty array
