class AssetApiSchema
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.AssetApiSchema |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#AssetApiSchema |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.AssetApiSchema |
Python | aws_cdk.aws_bedrock_agentcore_alpha.AssetApiSchema |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป AssetApiSchema |
Extends
Api
API Schema from a local asset.
The asset is uploaded to an S3 staging bucket, then moved to its final location by CloudFormation during deployment.
Example
const gateway = new agentcore.Gateway(this, "MyGateway", {
gatewayName: "my-gateway",
});
const smithySchema = agentcore.ApiSchema.fromLocalAsset(
path.join(__dirname, "models", "smithy-model.json")
);
smithySchema.bind(this);
// Create a gateway target with Smithy Model and OAuth
const target = agentcore.GatewayTarget.forSmithy(this, "MySmithyTarget", {
gatewayTargetName: "my-smithy-target",
description: "Target for Smithy model integration",
gateway: gateway,
smithyModel: smithySchema,
});
Initializer
new AssetApiSchema(path: string, options?: AssetOptions)
Parameters
- path
string - options
AssetOptions
Properties
| Name | Type | Description |
|---|---|---|
| bucket | string | The account ID of the S3 bucket owner for cross-account access. |
| inline | string | The inline OpenAPI schema definition as a string, if using an inline schema. |
| s3 | Location | The S3 location of the API schema file, if using an S3-based schema. |
bucketOwnerAccountId?
Type:
string
(optional)
The account ID of the S3 bucket owner for cross-account access.
inlineSchema?
Type:
string
(optional)
The inline OpenAPI schema definition as a string, if using an inline schema.
Can be in JSON or YAML format.
s3File?
Type:
Location
(optional)
The S3 location of the API schema file, if using an S3-based schema.
Contains the bucket name and object key information.
Methods
| Name | Description |
|---|---|
| bind(scope) | Binds this API schema to a construct scope. |
| grant | Grant permissions to the role. |
bind(scope)
public bind(scope: Construct): void
Parameters
- scope
Constructโ - The construct scope to bind to.
Binds this API schema to a construct scope.
This method initializes the S3 asset if it hasn't been initialized yet. Must be called before rendering the schema as CFN properties.
grantPermissionsToRole(role)
public grantPermissionsToRole(role: IRole): void
Parameters
- role
IRole
Grant permissions to the role.

.NET
Go
Java
Python
TypeScript (