Interface IAddOpenApiTargetOptions
(experimental) Options for adding an OpenAPI target to a gateway.
Namespace: Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
Assembly: Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.dll
Syntax (csharp)
public interface IAddOpenApiTargetOptions
Syntax (vb)
Public Interface IAddOpenApiTargetOptions
Remarks
Stability: Experimental
ExampleMetadata: infused
Examples
var gateway = new Gateway(this, "MyGateway", new GatewayProps {
GatewayName = "my-gateway"
});
// These ARNs are returned when creating the API key credential provider via Console or API
var apiKeyProviderArn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/apikeycredentialprovider/my-apikey";
var apiKeySecretArn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-apikey-secret-abc123";
var bucket = Bucket.FromBucketName(this, "ExistingBucket", "my-schema-bucket");
var s3mySchema = ApiSchema.FromS3File(bucket, "schemas/myschema.yaml");
// Add an OpenAPI target directly to the gateway
var target = gateway.AddOpenApiTarget("MyTarget", new AddOpenApiTargetOptions {
GatewayTargetName = "my-api-target",
Description = "Target for external API integration",
ApiSchema = s3mySchema,
CredentialProviderConfigurations = new [] { GatewayCredentialProvider.FromApiKeyIdentityArn(new ApiKeyCredentialProviderProps {
ProviderArn = apiKeyProviderArn,
SecretArn = apiKeySecretArn,
CredentialLocation = ApiKeyCredentialLocation.Header(new ApiKeyAdditionalConfiguration {
CredentialParameterName = "X-API-Key"
})
}) }
});
// This make sure your s3 bucket is available before target
target.Node.AddDependency(bucket);
Synopsis
Properties
| ApiSchema | (experimental) The OpenAPI schema defining the API. |
| CredentialProviderConfigurations | (experimental) Credential providers for authentication. |
| Description | (experimental) Optional description for the gateway target. |
| GatewayTargetName | (experimental) The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen). |
| ValidateOpenApiSchema | (experimental) Whether to validate the OpenAPI schema or not Note: Validation is only performed for inline and asset-based schema and during CDK synthesis. |
Properties
ApiSchema
(experimental) The OpenAPI schema defining the API.
ApiSchema ApiSchema { get; }
Property Value
Remarks
Stability: Experimental
CredentialProviderConfigurations
(experimental) Credential providers for authentication.
ICredentialProviderConfig[]? CredentialProviderConfigurations { get; }
Property Value
Remarks
Default: - [GatewayCredentialProvider.iamRole()]
Stability: Experimental
Description
(experimental) Optional description for the gateway target.
string? Description { get; }
Property Value
Remarks
Default: - No description
Stability: Experimental
GatewayTargetName
(experimental) The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).
string GatewayTargetName { get; }
Property Value
Remarks
Stability: Experimental
ValidateOpenApiSchema
(experimental) Whether to validate the OpenAPI schema or not Note: Validation is only performed for inline and asset-based schema and during CDK synthesis.
bool? ValidateOpenApiSchema { get; }
Property Value
bool?
Remarks
S3 schemas cannot be validated at synthesis time.
Default: true
Stability: Experimental