GatewayTargetOpenApiProps
- class aws_cdk.aws_bedrock_agentcore_alpha.GatewayTargetOpenApiProps(*, gateway_target_name, description=None, api_schema, gateway, credential_provider_configurations=None, validate_open_api_schema=None)
Bases:
GatewayTargetCommonProps(experimental) Properties for creating an OpenAPI-based Gateway Target.
- Parameters:
gateway_target_name (
str) – (experimental) The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$.description (
Optional[str]) – (experimental) Optional description for the gateway target The description can have up to 200 characters. Default: - No descriptionapi_schema (
ApiSchema) – (experimental) The OpenAPI schema defining the API.gateway (
IGateway) – (experimental) The gateway this target belongs to.credential_provider_configurations (
Optional[Sequence[ICredentialProviderConfig]]) – (experimental) 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 runtimevalidate_open_api_schema (
Optional[bool]) – (experimental) 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
- Stability:
experimental
- ExampleMetadata:
fixture=default infused
Example:
gateway = agentcore.Gateway(self, "MyGateway", gateway_name="my-gateway" ) # outbound auth (Use AWS console to create it, Once Identity L2 construct is available you can use it to create identity) 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
(experimental) The OpenAPI schema defining the API.
- Stability:
experimental
- credential_provider_configurations
(experimental) 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
- Stability:
experimental
- description
(experimental) Optional description for the gateway target The description can have up to 200 characters.
- Default:
No description
- Stability:
experimental
- gateway
(experimental) The gateway this target belongs to.
- Stability:
experimental
- gateway_target_name
^([0-9a-zA-Z][-]?){1,100}$.
- Stability:
experimental
- Type:
(experimental) 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
- Stability:
experimental
- Type:
(experimental) Whether to validate the OpenAPI schema (only applies to inline schemas) Note