Interface AddOpenApiTargetOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AddOpenApiTargetOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.129.0 (build eaca441)",
date="2026-05-19T08:18:44.197Z")
@Stability(Stable)
public interface AddOpenApiTargetOptions
extends software.amazon.jsii.JsiiSerializable
Options for adding an OpenAPI target to a gateway.
Example:
Gateway gateway = Gateway.Builder.create(this, "MyGateway")
.gatewayName("my-gateway")
.build();
// Create an API key credential provider in Token Vault
ApiKeyCredentialProvider apiKeyProvider = ApiKeyCredentialProvider.Builder.create(this, "MyApiKeyProvider")
.apiKeyCredentialProviderName("my-apikey")
.build();
IBucket bucket = Bucket.fromBucketName(this, "ExistingBucket", "my-schema-bucket");
S3ApiSchema s3mySchema = ApiSchema.fromS3File(bucket, "schemas/myschema.yaml");
// Add an OpenAPI target using the L2 construct directly
GatewayTarget target = gateway.addOpenApiTarget("MyTarget", AddOpenApiTargetOptions.builder()
.gatewayTargetName("my-api-target")
.description("Target for external API integration")
.apiSchema(s3mySchema)
.credentialProviderConfigurations(List.of(GatewayCredentialProvider.fromApiKeyIdentity(apiKeyProvider, FromApiKeyIdentityOptions.builder()
.credentialLocation(ApiKeyCredentialLocation.header(ApiKeyAdditionalConfiguration.builder()
.credentialParameterName("X-API-Key")
.build()))
.build())))
.build());
// This makes sure your s3 bucket is available before target
target.node.addDependency(bucket);
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forAddOpenApiTargetOptionsstatic final classAn implementation forAddOpenApiTargetOptions -
Method Summary
Modifier and TypeMethodDescriptionbuilder()The OpenAPI schema defining the API.default List<ICredentialProviderConfig> Credential providers for outbound authentication (OpenAPI targets use API Key or OAuth, not IAM).default StringOptional description for the gateway target.default StringThe name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).default BooleanWhether to validate the OpenAPI schema or not Note: Validation is only performed for inline and asset-based schema and during CDK synthesis.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getApiSchema
The OpenAPI schema defining the API. -
getCredentialProviderConfigurations
@Stability(Stable) @Nullable default List<ICredentialProviderConfig> getCredentialProviderConfigurations()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)
-
getDescription
Optional description for the gateway target.Default: - No description
-
getGatewayTargetName
The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).Default: - auto generate
-
getValidateOpenApiSchema
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
-
builder
- Returns:
- a
AddOpenApiTargetOptions.BuilderofAddOpenApiTargetOptions
-