class AssetToolSchema
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Bedrock.Agentcore.Alpha.AssetToolSchema |
Go | github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2#AssetToolSchema |
Java | software.amazon.awscdk.services.bedrock.agentcore.alpha.AssetToolSchema |
Python | aws_cdk.aws_bedrock_agentcore_alpha.AssetToolSchema |
TypeScript (source) | @aws-cdk/aws-bedrock-agentcore-alpha ยป AssetToolSchema |
Extends
Tool
Tool 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
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
import * as cdk from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_kms as interfaces_aws_kms } from 'aws-cdk-lib/interfaces';
declare const dockerImage: cdk.DockerImage;
declare const grantable: iam.IGrantable;
declare const keyRef: interfaces_aws_kms.IKeyRef;
declare const localBundling: cdk.ILocalBundling;
const assetToolSchema = new bedrock_agentcore_alpha.AssetToolSchema('path', /* all optional props */ {
assetHash: 'assetHash',
assetHashType: cdk.AssetHashType.SOURCE,
bundling: {
image: dockerImage,
// the properties below are optional
bundlingFileAccess: cdk.BundlingFileAccess.VOLUME_COPY,
command: ['command'],
entrypoint: ['entrypoint'],
environment: {
environmentKey: 'environment',
},
local: localBundling,
network: 'network',
outputType: cdk.BundlingOutput.ARCHIVED,
platform: 'platform',
securityOpt: 'securityOpt',
user: 'user',
volumes: [{
containerPath: 'containerPath',
hostPath: 'hostPath',
// the properties below are optional
consistency: cdk.DockerVolumeConsistency.CONSISTENT,
}],
volumesFrom: ['volumesFrom'],
workingDirectory: 'workingDirectory',
},
deployTime: false,
displayName: 'displayName',
exclude: ['exclude'],
followSymlinks: cdk.SymlinkFollowMode.NEVER,
ignoreMode: cdk.IgnoreMode.GLOB,
readers: [grantable],
sourceKMSKey: keyRef,
});
Initializer
new AssetToolSchema(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 | Tool[] | The inline tool schema definition as a string, if using an inline schema. |
| s3 | Location | The S3 location of the tool 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:
Tool[]
(optional)
The inline tool 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 tool schema file, if using an S3-based schema.
Contains the bucket name and object key information.
Methods
| Name | Description |
|---|---|
| bind(scope) | Binds this tool 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 tool 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 (