Show / Hide Table of Contents

Class ApiKeyAdditionalConfiguration

API Key additional configuration.

Inheritance
object
ApiKeyAdditionalConfiguration
Implements
IApiKeyAdditionalConfiguration
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.BedrockAgentCore
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ApiKeyAdditionalConfiguration : IApiKeyAdditionalConfiguration
Syntax (vb)
Public Class ApiKeyAdditionalConfiguration Implements IApiKeyAdditionalConfiguration
Remarks

ExampleMetadata: infused

Examples
var gateway = new Gateway(this, "MyGateway", new GatewayProps {
                GatewayName = "my-gateway"
            });

            // Create an API key credential provider in Token Vault
            var apiKeyProvider = new ApiKeyCredentialProvider(this, "MyApiKeyProvider", new ApiKeyCredentialProviderProps {
                ApiKeyCredentialProviderName = "my-apikey"
            });

            var bucket = Bucket.FromBucketName(this, "ExistingBucket", "my-schema-bucket");
            var s3mySchema = ApiSchema.FromS3File(bucket, "schemas/myschema.yaml");

            // Add an OpenAPI target using the L2 construct directly
            var target = gateway.AddOpenApiTarget("MyTarget", new AddOpenApiTargetOptions {
                GatewayTargetName = "my-api-target",
                Description = "Target for external API integration",
                ApiSchema = s3mySchema,
                CredentialProviderConfigurations = new [] { GatewayCredentialProvider.FromApiKeyIdentity(apiKeyProvider, new FromApiKeyIdentityOptions {
                    CredentialLocation = ApiKeyCredentialLocation.Header(new ApiKeyAdditionalConfiguration {
                        CredentialParameterName = "X-API-Key"
                    })
                }) }
            });

            // This makes sure your s3 bucket is available before target
            target.Node.AddDependency(bucket);

Synopsis

Constructors

ApiKeyAdditionalConfiguration()

API Key additional configuration.

Properties

CredentialParameterName

The name of the credential parameter for the API key.

CredentialPrefix

The prefix for the API key credential.

Constructors

ApiKeyAdditionalConfiguration()

API Key additional configuration.

public ApiKeyAdditionalConfiguration()
Remarks

ExampleMetadata: infused

Examples
var gateway = new Gateway(this, "MyGateway", new GatewayProps {
                GatewayName = "my-gateway"
            });

            // Create an API key credential provider in Token Vault
            var apiKeyProvider = new ApiKeyCredentialProvider(this, "MyApiKeyProvider", new ApiKeyCredentialProviderProps {
                ApiKeyCredentialProviderName = "my-apikey"
            });

            var bucket = Bucket.FromBucketName(this, "ExistingBucket", "my-schema-bucket");
            var s3mySchema = ApiSchema.FromS3File(bucket, "schemas/myschema.yaml");

            // Add an OpenAPI target using the L2 construct directly
            var target = gateway.AddOpenApiTarget("MyTarget", new AddOpenApiTargetOptions {
                GatewayTargetName = "my-api-target",
                Description = "Target for external API integration",
                ApiSchema = s3mySchema,
                CredentialProviderConfigurations = new [] { GatewayCredentialProvider.FromApiKeyIdentity(apiKeyProvider, new FromApiKeyIdentityOptions {
                    CredentialLocation = ApiKeyCredentialLocation.Header(new ApiKeyAdditionalConfiguration {
                        CredentialParameterName = "X-API-Key"
                    })
                }) }
            });

            // This makes sure your s3 bucket is available before target
            target.Node.AddDependency(bucket);

Properties

CredentialParameterName

The name of the credential parameter for the API key.

public string? CredentialParameterName { get; set; }
Property Value

string

Remarks

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

CredentialPrefix

The prefix for the API key credential.

public string? CredentialPrefix { get; set; }
Property Value

string

Remarks

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

Implements

IApiKeyAdditionalConfiguration
Back to top Generated by DocFX