Skip to content

Commit

Permalink
bug: Fixed aurora engine value (aws-samples#540)
Browse files Browse the repository at this point in the history
* bug: Fix parsing RSS feed on creation

* bug: Fixed aurora engine value
  • Loading branch information
charles-marion authored Aug 9, 2024
1 parent c781a6f commit 1c8cc7d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
14 changes: 8 additions & 6 deletions lib/rag-engines/data-import/rss-subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class RssSubscription extends Construct {
constructor(scope: Construct, id: string, props: RssSubscriptionProperties) {
super(scope, id);

const rssIngestorFunction = new lambda.Function(this, "RssIngestor", {
this.rssIngestorFunction = new lambda.Function(this, "RssIngestor", {
code: props.shared.sharedCode.bundleWithLambdaAsset(
path.join(__dirname, "./functions/rss-ingestor")
),
Expand Down Expand Up @@ -55,11 +55,13 @@ export class RssSubscription extends Construct {
},
});

props.shared.configParameter.grantRead(rssIngestorFunction);
props.shared.configParameter.grantRead(this.rssIngestorFunction);
props.ragDynamoDBTables.documentsTable.grantReadWriteData(
rssIngestorFunction
this.rssIngestorFunction
);
props.ragDynamoDBTables.workspacesTable.grantReadData(
this.rssIngestorFunction
);
props.ragDynamoDBTables.workspacesTable.grantReadData(rssIngestorFunction);

const triggerRssIngestorsFunction = new lambda.Function(
this,
Expand Down Expand Up @@ -91,12 +93,12 @@ export class RssSubscription extends Construct {
DOCUMENTS_BY_STATUS_INDEX:
props.ragDynamoDBTables.documentsByStatusIndexName ?? "",
PROCESSING_BUCKET_NAME: props.processingBucket.bucketName,
RSS_FEED_INGESTOR_FUNCTION: rssIngestorFunction.functionName,
RSS_FEED_INGESTOR_FUNCTION: this.rssIngestorFunction.functionName,
},
}
);

rssIngestorFunction.grantInvoke(triggerRssIngestorsFunction);
this.rssIngestorFunction.grantInvoke(triggerRssIngestorsFunction);
props.shared.configParameter.grantRead(triggerRssIngestorsFunction);

props.ragDynamoDBTables.documentsTable.grantReadData(
Expand Down
4 changes: 2 additions & 2 deletions lib/shared/layers/python-sdk/python/genai_core/workspaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def create_workspace_aurora(
"object_type": WORKSPACE_OBJECT_TYPE,
"format_version": 1,
"name": workspace_name,
"engine": WorkspaceStatus.SUBMITTED.value,
"status": "submitted",
"engine": "aurora",
"status": WorkspaceStatus.SUBMITTED.value,
"embeddings_model_provider": embeddings_model_provider,
"embeddings_model_name": embeddings_model_name,
"embeddings_model_dimensions": embeddings_model_dimensions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3400,7 +3400,12 @@ schema {
"PROCESSING_BUCKET_NAME": {
"Ref": "RagEnginesDataImportProcessingBucketA7BE9701",
},
"RSS_FEED_INGESTOR_FUNCTION": "",
"RSS_FEED_INGESTOR_FUNCTION": {
"Fn::GetAtt": [
"RagEnginesDataImportRssSubscriptionRssIngestorC19E7D9E",
"Arn",
],
},
"SAGEMAKER_RAG_MODELS_ENDPOINT": {
"Fn::GetAtt": [
"RagEnginesSageMakerModelMultiAB24AEndpoint6DA7D681",
Expand Down Expand Up @@ -3658,6 +3663,32 @@ schema {
},
],
},
{
"Action": "lambda:InvokeFunction",
"Effect": "Allow",
"Resource": [
{
"Fn::GetAtt": [
"RagEnginesDataImportRssSubscriptionRssIngestorC19E7D9E",
"Arn",
],
},
{
"Fn::Join": [
"",
[
{
"Fn::GetAtt": [
"RagEnginesDataImportRssSubscriptionRssIngestorC19E7D9E",
"Arn",
],
},
":*",
],
],
},
],
},
{
"Action": [
"secretsmanager:GetSecretValue",
Expand Down

0 comments on commit 1c8cc7d

Please sign in to comment.