# GatewayTargetOpenApiProps

Properties for creating an OpenAPI-based Gateway Target.

Extends: GatewayTargetOpenApiProps
Extends: GatewayTargetCommonProps

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

## Example

```ts

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

// Outbound auth: ApiKeyCredentialProvider + bindForGatewayApiKeyTarget, or ARNs from console/API
const apiKeyIdentityArn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey"
const apiKeySecretArn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123"

const opneapiSchema = agentcore.ApiSchema.fromLocalAsset(path.join(__dirname, "mySchema.yml"));
opneapiSchema.bind(this);

// Create a gateway target with OpenAPI Schema
const target = agentcore.GatewayTarget.forOpenApi(this, "MyTarget", {
  gatewayTargetName: "my-api-target",
  description: "Target for external API integration",
  gateway: gateway,  // Note: you need to pass the gateway reference
  apiSchema: opneapiSchema,
  credentialProviderConfigurations: [
    agentcore.GatewayCredentialProvider.fromApiKeyIdentityArn({
     providerArn: apiKeyIdentityArn,
     secretArn: apiKeySecretArn
    }),
  ],
});
```

## Properties

- `apiSchema`: [ApiSchema](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.ApiSchema.html) (required) — The OpenAPI schema defining the API.

- `credentialProviderConfigurations`: [ICredentialProviderConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.ICredentialProviderConfig.html)[] — Credential providers for authentication OpenAPI targets support API key and OAuth authentication (not IAM).

  **Default:** If not provided, defaults to IAM role which will fail at runtime

- `description`: string — Optional description for the gateway target The description can have up to 200 characters.

  **Default:** No description

- `gateway`: [IGateway](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.IGateway.html) (required) — The gateway this target belongs to.

- `gatewayTargetName`: string — The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$.

  **Default:** auto generate

- `validateOpenApiSchema`: boolean = true — Whether to validate the OpenAPI schema (only applies to inline schemas) Note: Validation is only performed for inline schemas during CDK synthesis.

  S3 and asset-based schemas cannot be validated at synthesis time.
