@cdklabs/generative-ai-cdk-constructs
@cdklabs/generative-ai-cdk-constructs / s3vectors / IVectorBucket
Interface for S3 vector bucket resources
IResource
readonlyoptionalcreationTime:string
The timestamp when the vector bucket was created, in ISO 8601 format.
readonlyoptionalencryptionKey:IKey
Optional KMS encryption key associated with this vector bucket.
readonlyenv:ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
IResource.env
readonlynode:Node
The tree node.
IResource.node
optionalpolicy:VectorBucketPolicy
The resource policy associated with this bucket.
If autoCreatePolicy is true, a BucketPolicy will be created upon the
first call to addToResourcePolicy(s).
readonlystack:Stack
The stack in which this resource is defined.
IResource.stack
readonlyvectorBucketArn:string
The ARN of the vector bucket
readonlyvectorBucketName:string
The name of the vector bucket
addToResourcePolicy(
permission):AddToResourcePolicyResult
Adds a statement to the resource policy for a principal (i.e.
account/role/service) to perform actions on this bucket and/or its
contents. Use bucketArn to obtain ARNs for
this bucket.
Note that the policy statement may or may not be added to the policy.
For example, when an IBucket is created from an existing bucket,
it’s not possible to tell whether the bucket already has a policy
attached, let alone to re-use that policy to add more statements to it.
So it’s safest to do nothing in these cases.
PolicyStatement
the policy statement to be added to the bucket’s policy.
AddToResourcePolicyResult
metadata about the execution of this method. If the policy
was not added, the value of statementAdded will be false. You
should always check this value to make sure that the operation was
actually carried out. Otherwise, synthesis and deploy will terminate
silently, which may be confusing.
applyRemovalPolicy(
policy):void
Apply the given removal policy to this resource
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
RemovalPolicy
void
IResource.applyRemovalPolicy
grantDelete(
grantee,indexIds?):Grant
Grants IAM actions to the IAM Principal to delete the vector bucket and indexes
IGrantable
The IAM principal to grant permissions to
any
Restrict the permission to a certain set of indexes (default ‘*’). Parameter type is any but string[] should be passed in.
Grant
An IAM Grant object representing the granted permissions
grantRead(
grantee,indexIds?):Grant
Grants IAM actions to the IAM Principal
IGrantable
The IAM principal to grant permissions to
any
Restrict the permission to a certain set of indexes (default ‘*’). Parameter type is any but string[] should be passed in.
Grant
An IAM Grant object representing the granted permissions
grantWrite(
grantee,indexIds?):Grant
Grants IAM actions to the IAM Principal
IGrantable
The IAM principal to grant permissions to
any
Restrict the permission to a certain set of indexes (default ‘*’). Parameter type is any but string[] should be passed in.
Grant
An IAM Grant object representing the granted permissions