Skip to content

Commit

Permalink
Corrected the NagSuppression conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
azaylamba committed Apr 20, 2024
1 parent a09713e commit dca47d0
Showing 1 changed file with 55 additions and 54 deletions.
109 changes: 55 additions & 54 deletions lib/aws-genai-llm-chatbot-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export class AwsGenAILLMChatbotStack extends cdk.Stack {
api: chatBotApi,
chatbotFilesBucket: chatBotApi.filesBucket,
crossEncodersEnabled: props.config.rag.crossEncodingEnabled,
sagemakerEmbeddingsEnabled: props.config.rag.enableEmbeddingModelsViaSagemaker,
sagemakerEmbeddingsEnabled:
props.config.rag.enableEmbeddingModelsViaSagemaker,
});

/**
Expand Down Expand Up @@ -291,59 +292,59 @@ export class AwsGenAILLMChatbotStack extends cdk.Stack {
},
]
);
if (props.config.rag.engines.aurora.enabled) {
NagSuppressions.addResourceSuppressionsByPath(
this,
`/${this.stackName}/RagEngines/AuroraPgVector/AuroraDatabase/Secret/Resource`,
[
{
id: "AwsSolutions-SMG4",
reason: "Secret created implicitly by CDK.",
},
]
);
NagSuppressions.addResourceSuppressionsByPath(
this,
[
`/${this.stackName}/RagEngines/AuroraPgVector/DatabaseSetupFunction/ServiceRole/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/DatabaseSetupProvider/framework-onEvent/ServiceRole/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/DatabaseSetupProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/CreateAuroraWorkspace/CreateAuroraWorkspaceFunction/ServiceRole/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/CreateAuroraWorkspace/CreateAuroraWorkspaceFunction/ServiceRole/DefaultPolicy/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/CreateAuroraWorkspace/CreateAuroraWorkspace/Role/DefaultPolicy/Resource`,
],
[
{
id: "AwsSolutions-IAM4",
reason: "IAM role implicitly created by CDK.",
},
{
id: "AwsSolutions-IAM5",
reason: "IAM role implicitly created by CDK.",
},
]
);
}
if (props.config.rag.engines.opensearch.enabled) {
NagSuppressions.addResourceSuppressionsByPath(
this,
[
`/${this.stackName}/RagEngines/OpenSearchVector/CreateOpenSearchWorkspace/CreateOpenSearchWorkspaceFunction/ServiceRole/Resource`,
`/${this.stackName}/RagEngines/OpenSearchVector/CreateOpenSearchWorkspace/CreateOpenSearchWorkspaceFunction/ServiceRole/DefaultPolicy/Resource`,
`/${this.stackName}/RagEngines/OpenSearchVector/CreateOpenSearchWorkspace/CreateOpenSearchWorkspace/Role/DefaultPolicy/Resource`,
],
[
{
id: "AwsSolutions-IAM4",
reason: "IAM role implicitly created by CDK.",
},
{
id: "AwsSolutions-IAM5",
reason: "IAM role implicitly created by CDK.",
},
]
);
}
}
if (props.config.rag.engines.aurora.enabled) {
NagSuppressions.addResourceSuppressionsByPath(
this,
`/${this.stackName}/RagEngines/AuroraPgVector/AuroraDatabase/Secret/Resource`,
[
{
id: "AwsSolutions-SMG4",
reason: "Secret created implicitly by CDK.",
},
]
);
NagSuppressions.addResourceSuppressionsByPath(
this,
[
`/${this.stackName}/RagEngines/AuroraPgVector/DatabaseSetupFunction/ServiceRole/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/DatabaseSetupProvider/framework-onEvent/ServiceRole/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/DatabaseSetupProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/CreateAuroraWorkspace/CreateAuroraWorkspaceFunction/ServiceRole/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/CreateAuroraWorkspace/CreateAuroraWorkspaceFunction/ServiceRole/DefaultPolicy/Resource`,
`/${this.stackName}/RagEngines/AuroraPgVector/CreateAuroraWorkspace/CreateAuroraWorkspace/Role/DefaultPolicy/Resource`,
],
[
{
id: "AwsSolutions-IAM4",
reason: "IAM role implicitly created by CDK.",
},
{
id: "AwsSolutions-IAM5",
reason: "IAM role implicitly created by CDK.",
},
]
);
}
if (props.config.rag.engines.opensearch.enabled) {
NagSuppressions.addResourceSuppressionsByPath(
this,
[
`/${this.stackName}/RagEngines/OpenSearchVector/CreateOpenSearchWorkspace/CreateOpenSearchWorkspaceFunction/ServiceRole/Resource`,
`/${this.stackName}/RagEngines/OpenSearchVector/CreateOpenSearchWorkspace/CreateOpenSearchWorkspaceFunction/ServiceRole/DefaultPolicy/Resource`,
`/${this.stackName}/RagEngines/OpenSearchVector/CreateOpenSearchWorkspace/CreateOpenSearchWorkspace/Role/DefaultPolicy/Resource`,
],
[
{
id: "AwsSolutions-IAM4",
reason: "IAM role implicitly created by CDK.",
},
{
id: "AwsSolutions-IAM5",
reason: "IAM role implicitly created by CDK.",
},
]
);
}
if (props.config.rag.engines.kendra.enabled) {
NagSuppressions.addResourceSuppressionsByPath(
Expand Down

0 comments on commit dca47d0

Please sign in to comment.