Skip to content

Commit 0847c0c

Browse files
authored
fix(bedrock): use CfnDataSource and construct's dataSourceId as unique id (fixes #470) (#471)
1 parent a8d4373 commit 0847c0c

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

apidocs/classes/bedrock.S3DataSource.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Construct.constructor
5555

5656
### dataSource
5757

58-
`Readonly` **dataSource**: `CfnResource`
58+
`Readonly` **dataSource**: `CfnDataSource`
5959

6060
The Data Source cfn resource.
6161

src/cdk-lib/bedrock/s3-data-source.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
* and limitations under the License.
1212
*/
1313

14-
import * as cdk from 'aws-cdk-lib';
1514
import { aws_bedrock as bedrock } from 'aws-cdk-lib';
1615
import * as kms from 'aws-cdk-lib/aws-kms';
1716
import * as s3 from 'aws-cdk-lib/aws-s3';
@@ -103,7 +102,7 @@ export class S3DataSource extends Construct {
103102
/**
104103
* The Data Source cfn resource.
105104
*/
106-
public readonly dataSource: cdk.CfnResource;
105+
public readonly dataSource: bedrock.CfnDataSource;
107106
/**
108107
* The unique identifier of the data source.
109108
*/
@@ -152,8 +151,7 @@ export class S3DataSource extends Construct {
152151

153152
});
154153

155-
this.dataSourceId = dataSourceName;
156-
154+
this.dataSourceId = this.dataSource.attrDataSourceId;
157155
}
158156
}
159157

@@ -208,4 +206,4 @@ function vectorIngestionConfiguration(
208206
return {};
209207
}
210208

211-
}
209+
}

0 commit comments

Comments
 (0)