GatewayTargetOpenApiProps

class aws_cdk.aws_bedrockagentcore.GatewayTargetOpenApiProps(*, description=None, gateway_target_name=None, api_schema, gateway, credential_provider_configurations=None, validate_open_api_schema=None)

Bases: GatewayTargetCommonProps

Properties for creating an OpenAPI-based Gateway Target.

Parameters:
  • description (Optional[str]) – Optional description for the gateway target The description can have up to 200 characters. Default: - No description

  • gateway_target_name (Optional[str]) – The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$. Default: - auto generate

  • api_schema (ApiSchema) – The OpenAPI schema defining the API.

  • gateway (IGateway) – The gateway this target belongs to.

  • credential_provider_configurations (Optional[Sequence[ICredentialProviderConfig]]) – 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

  • validate_open_api_schema (Optional[bool]) – 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. Default: true

ExampleMetadata:

fixture=default infused

Example:

gateway = agentcore.Gateway(self, "MyGateway",
    gateway_name="my-gateway"
)

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

opneapi_schema = agentcore.ApiSchema.from_local_asset(path.join(__dirname, "mySchema.yml"))
opneapi_schema.bind(self)

# Create a gateway target with OpenAPI Schema
target = agentcore.GatewayTarget.for_open_api(self, "MyTarget",
    gateway_target_name="my-api-target",
    description="Target for external API integration",
    gateway=gateway,  # Note: you need to pass the gateway reference
    api_schema=opneapi_schema,
    credential_provider_configurations=[
        agentcore.GatewayCredentialProvider.from_api_key_identity_arn(
            provider_arn=api_key_identity_arn,
            secret_arn=api_key_secret_arn
        )
    ]
)

Attributes

api_schema

The OpenAPI schema defining the API.

credential_provider_configurations

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

Optional description for the gateway target The description can have up to 200 characters.

Default:
  • No description

gateway

The gateway this target belongs to.

gateway_target_name

^([0-9a-zA-Z][-]?){1,100}$.

Default:
  • auto generate

Type:

The name of the gateway target The name must be unique within the gateway Pattern

validate_open_api_schema

Validation is only performed for inline schemas during CDK synthesis.

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

Default:

true

Type:

Whether to validate the OpenAPI schema (only applies to inline schemas) Note