class ApiSchema
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.ApiSchema |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#ApiSchema |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.ApiSchema |
Python | aws_cdk.aws_bedrock_agentcore_alpha.ApiSchema |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป ApiSchema |
Implemented by
Asset, Inline, S3
Represents the concept of an API Schema for a Gateway Target.
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 (protected)
super(s3File?: Location, bucketOwnerAccountId?: string, inlineSchema?: string)
Parameters
- s3File
Location - bucketOwnerAccountId
string - inlineSchema
string
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) | Bind the schema to a construct. |
| grant | Grant permissions to the role. |
| static from | Creates an API Schema from an inline string. |
| static from | Creates an API Schema from a local file. |
| static from | Creates an API Schema from an S3 File. |
bind(scope)
public bind(scope: Construct): void
Parameters
- scope
Construct
Bind the schema to a construct.
grantPermissionsToRole(role)
public grantPermissionsToRole(role: IRole): void
Parameters
- role
IRole
Grant permissions to the role.
static fromInline(schema)
public static fromInline(schema: string): InlineApiSchema
Parameters
- schema
stringโ - the JSON or YAML payload defining the schema (OpenAPI or Smithy).
Returns
Creates an API Schema from an inline string.
static fromLocalAsset(path)
public static fromLocalAsset(path: string): AssetApiSchema
Parameters
- path
stringโ - the path to the local file containing the OpenAPI schema for the action group.
Returns
Creates an API Schema from a local file.
static fromS3File(bucket, objectKey, bucketOwnerAccountId?)
public static fromS3File(bucket: IBucket, objectKey: string, bucketOwnerAccountId?: string): S3ApiSchema
Parameters
- bucket
IBucketโ - the bucket containing the local file containing the OpenAPI schema for the action group. - objectKey
stringโ - object key in the bucket. - bucketOwnerAccountId
stringโ - optional The account ID of the Amazon S3 bucket owner.
Returns
Creates an API Schema from an S3 File.

.NET
Go
Java
Python
TypeScript (