AddOpenApiTargetOptions
- class aws_cdk.aws_bedrock_agentcore_alpha.AddOpenApiTargetOptions(*, api_schema, gateway_target_name, credential_provider_configurations=None, description=None, validate_open_api_schema=None)
Bases:
object(experimental) Options for adding an OpenAPI target to a gateway.
- Parameters:
api_schema (
ApiSchema) – (experimental) The OpenAPI schema defining the API.gateway_target_name (
str) – (experimental) The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).credential_provider_configurations (
Optional[Sequence[ICredentialProviderConfig]]) – (experimental) Credential providers for authentication. Default: - [GatewayCredentialProvider.iamRole()]description (
Optional[str]) – (experimental) Optional description for the gateway target. Default: - No descriptionvalidate_open_api_schema (
Optional[bool]) – (experimental) Whether to validate the OpenAPI schema or not Note: Validation is only performed for inline and asset-based schema and during CDK synthesis. S3 schemas cannot be validated at synthesis time. Default: true
- Stability:
experimental
- ExampleMetadata:
infused
Example:
gateway = agentcore.Gateway(self, "MyGateway", gateway_name="my-gateway" ) # These ARNs are returned when creating the API key credential provider via Console or API api_key_provider_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" bucket = s3.Bucket.from_bucket_name(self, "ExistingBucket", "my-schema-bucket") s3my_schema = agentcore.ApiSchema.from_s3_file(bucket, "schemas/myschema.yaml") # Add an OpenAPI target directly to the gateway target = gateway.add_open_api_target("MyTarget", gateway_target_name="my-api-target", description="Target for external API integration", api_schema=s3my_schema, credential_provider_configurations=[ agentcore.GatewayCredentialProvider.from_api_key_identity_arn( provider_arn=api_key_provider_arn, secret_arn=api_key_secret_arn, credential_location=agentcore.ApiKeyCredentialLocation.header( credential_parameter_name="X-API-Key" ) ) ] ) # This make sure your s3 bucket is available before target target.node.add_dependency(bucket)
Attributes
- api_schema
(experimental) The OpenAPI schema defining the API.
- Stability:
experimental
- credential_provider_configurations
(experimental) Credential providers for authentication.
- Default:
[GatewayCredentialProvider.iamRole()]
- Stability:
experimental
- description
(experimental) Optional description for the gateway target.
- Default:
No description
- Stability:
experimental
- gateway_target_name
(experimental) The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).
- Stability:
experimental
- validate_open_api_schema
Validation is only performed for inline and asset-based schema and during CDK synthesis.
S3 schemas cannot be validated at synthesis time.
- Default:
true
- Stability:
experimental
- Type:
(experimental) Whether to validate the OpenAPI schema or not Note