ApiKeyAdditionalConfiguration

class aws_cdk.aws_bedrock_agentcore_alpha.ApiKeyAdditionalConfiguration(*, credential_parameter_name=None, credential_prefix=None)

Bases: object

(experimental) API Key additional configuration.

Parameters:
  • credential_parameter_name (Optional[str]) – (experimental) The name of the credential parameter for the API key. This parameter name is used when sending the API key to the target endpoint. Length Constraints: Minimum length of 1. Maximum length of 64. Default: - ‘Authorization’ for HEADER, ‘api_key’ for QUERY_PARAMETER

  • credential_prefix (Optional[str]) – (experimental) The prefix for the API key credential. This prefix is added to the API key when sending it to the target endpoint. Length Constraints: Minimum length of 1. Maximum length of 64. Default: - ‘Bearer ‘ for HEADER, no prefix for QUERY_PARAMETER

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

credential_parameter_name

(experimental) The name of the credential parameter for the API key.

This parameter name is used when sending the API key to the target endpoint.

Length Constraints: Minimum length of 1. Maximum length of 64.

Default:
  • ‘Authorization’ for HEADER, ‘api_key’ for QUERY_PARAMETER

Stability:

experimental

credential_prefix

(experimental) The prefix for the API key credential.

This prefix is added to the API key when sending it to the target endpoint.

Length Constraints: Minimum length of 1. Maximum length of 64.

Default:
  • ‘Bearer ‘ for HEADER, no prefix for QUERY_PARAMETER

Stability:

experimental