Skip to content

Commit

Permalink
fix(bedrock): use CfnDataSource and construct's dataSourceId as uniqu…
Browse files Browse the repository at this point in the history
…e id (fixes #470) (#471)
  • Loading branch information
kraashen authored May 22, 2024
1 parent a8d4373 commit 0847c0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apidocs/classes/bedrock.S3DataSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Construct.constructor

### dataSource

`Readonly` **dataSource**: `CfnResource`
`Readonly` **dataSource**: `CfnDataSource`

The Data Source cfn resource.

Expand Down
8 changes: 3 additions & 5 deletions src/cdk-lib/bedrock/s3-data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* and limitations under the License.
*/

import * as cdk from 'aws-cdk-lib';
import { aws_bedrock as bedrock } from 'aws-cdk-lib';
import * as kms from 'aws-cdk-lib/aws-kms';
import * as s3 from 'aws-cdk-lib/aws-s3';
Expand Down Expand Up @@ -103,7 +102,7 @@ export class S3DataSource extends Construct {
/**
* The Data Source cfn resource.
*/
public readonly dataSource: cdk.CfnResource;
public readonly dataSource: bedrock.CfnDataSource;
/**
* The unique identifier of the data source.
*/
Expand Down Expand Up @@ -152,8 +151,7 @@ export class S3DataSource extends Construct {

});

this.dataSourceId = dataSourceName;

this.dataSourceId = this.dataSource.attrDataSourceId;
}
}

Expand Down Expand Up @@ -208,4 +206,4 @@ function vectorIngestionConfiguration(
return {};
}

}
}

0 comments on commit 0847c0c

Please sign in to comment.