AddOpenApiTargetOptions

class aws_cdk.aws_bedrock_agentcore_alpha.AddOpenApiTargetOptions(*, api_schema, credential_provider_configurations=None, description=None, gateway_target_name=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.

  • credential_provider_configurations (Optional[Sequence[ICredentialProviderConfig]]) – (experimental) Credential providers for outbound authentication (OpenAPI targets use API Key or OAuth, not IAM). Default: - none (no credential configuration on the target; supply providers for secured backends)

  • description (Optional[str]) – (experimental) Optional description for the gateway target. Default: - No description

  • gateway_target_name (Optional[str]) – (experimental) The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen). Default: - auto generate

  • validate_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"
)

# Create an API key credential provider in Token Vault
api_key_provider = agentcore.ApiKeyCredentialProvider(self, "MyApiKeyProvider",
    api_key_credential_provider_name="my-apikey"
)

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 using the L2 construct directly
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(api_key_provider,
            credential_location=agentcore.ApiKeyCredentialLocation.header(
                credential_parameter_name="X-API-Key"
            )
        )
    ]
)

# This makes 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 outbound authentication (OpenAPI targets use API Key or OAuth, not IAM).

Default:
  • none (no credential configuration on the target; supply providers for secured backends)

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).

Default:
  • auto generate

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