Class S3ApiSchema
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrockagentcore.ApiSchema
software.amazon.awscdk.services.bedrockagentcore.S3ApiSchema
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.129.0 (build eaca441)",
date="2026-05-19T08:18:44.503Z")
@Stability(Stable)
public class S3ApiSchema
extends ApiSchema
Class to define an API Schema from an S3 object.
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 ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
ConstructorsModifierConstructorDescriptionS3ApiSchema(Location location) S3ApiSchema(Location location, String bucketOwnerAccountId) protectedS3ApiSchema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedS3ApiSchema(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(software.constructs.Construct scope) Bind the schema to a construct.The account ID of the S3 bucket owner for cross-account access.voidgrantPermissionsToRole(IRole role) Grant permissions to the role.Methods inherited from class software.amazon.awscdk.services.bedrockagentcore.ApiSchema
fromInline, fromLocalAsset, fromS3File, fromS3File, getInlineSchema, getS3FileMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
S3ApiSchema
protected S3ApiSchema(software.amazon.jsii.JsiiObjectRef objRef) -
S3ApiSchema
protected S3ApiSchema(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
S3ApiSchema
@Stability(Stable) public S3ApiSchema(@NotNull Location location, @Nullable String bucketOwnerAccountId) - Parameters:
location- This parameter is required.bucketOwnerAccountId- The account ID of the S3 bucket owner for cross-account access.
-
S3ApiSchema
- Parameters:
location- This parameter is required.
-
-
Method Details
-
bind
@Stability(Stable) public void bind(@NotNull software.constructs.Construct scope) Bind the schema to a construct. -
grantPermissionsToRole
Grant permissions to the role.- Specified by:
grantPermissionsToRolein classApiSchema- Parameters:
role- This parameter is required.
-
getBucketOwnerAccountId
The account ID of the S3 bucket owner for cross-account access.- Overrides:
getBucketOwnerAccountIdin classApiSchema
-