Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@
* and limitations under the License.
*/

import { JsonPatch, awscdk, ReleasableCommits } from 'projen';
import { awscdk, JsonPatch, ReleasableCommits } from 'projen';
import { NpmAccess } from 'projen/lib/javascript';
import { buildUpgradeMainPRCustomJob } from './projenrc/github-jobs';
import {
buildAutoApproveWorkflow,
buildCodeGenerationWorkflow,
buildMeritBadgerWorkflow,
buildMonthlyIssuesMetricsWorkflow,
buildAutoApproveWorkflow,
buildOrtToolkitWorkflow,
runSemGrepWorkflow,
runBanditWorkflow,
runCommitLintWorkflow,
buildCodeGenerationWorkflow,
runSemGrepWorkflow,
} from './projenrc/github-workflows';

// Constants
const GITHUB_USER = 'awslabs';
const PUBLICATION_NAMESPACE = 'cdklabs';
const PROJECT_NAME = 'generative-ai-cdk-constructs';
const CDK_VERSION: string = '2.191.0';
const CDK_VERSION: string = '2.206.0';

function camelCaseIt(input: string): string {
// Hypens and dashes to spaces and then CamelCase...
Expand Down
51 changes: 51 additions & 0 deletions apidocs/@cdklabs/namespaces/bedrock/classes/Guardrail.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ The content filters applied by the guardrail.

***

### contentFiltersTier?

> `optional` **contentFiltersTier**: `string`

The content filters tier of the guardrail.

#### Overrides

[`GuardrailBase`](GuardrailBase.md).[`contentFiltersTier`](GuardrailBase.md#contentfilterstier)

***

### contextualGroundingFilters

> `readonly` **contextualGroundingFilters**: [`ContextualGroundingFilter`](../interfaces/ContextualGroundingFilter.md)[]
Expand Down Expand Up @@ -100,6 +112,18 @@ The ARN of the guardrail.

***

### guardrailCrossRegionProfile?

> `optional` **guardrailCrossRegionProfile**: `string`

The cross-region inference profile of the guardrail.

#### Overrides

[`GuardrailBase`](GuardrailBase.md).[`guardrailCrossRegionProfile`](GuardrailBase.md#guardrailcrossregionprofile)

***

### guardrailId

> `readonly` **guardrailId**: `string`
Expand Down Expand Up @@ -251,6 +275,18 @@ The stack in which this resource is defined.

***

### topicFiltersTier?

> `optional` **topicFiltersTier**: `string`

The topics filters tier of the guardrail.

#### Overrides

[`GuardrailBase`](GuardrailBase.md).[`topicFiltersTier`](GuardrailBase.md#topicfilterstier)

***

### wordFilters

> `readonly` **wordFilters**: [`WordFilter`](../interfaces/WordFilter.md)[]
Expand Down Expand Up @@ -508,6 +544,21 @@ The guardrail version.

***

### generateCrossRegionConfig()

> **generateCrossRegionConfig**(): `undefined` \| `IResolvable` \| `GuardrailCrossRegionConfigProperty`

Generates the cross-region configuration for the guardrail.
This method is a placeholder and should be implemented in subclasses if needed.

#### Returns

`undefined` \| `IResolvable` \| `GuardrailCrossRegionConfigProperty`

The cross-region configuration or undefined if not applicable.

***

### generatePhysicalName()

> `protected` **generatePhysicalName**(): `string`
Expand Down
37 changes: 37 additions & 0 deletions apidocs/@cdklabs/namespaces/bedrock/classes/GuardrailBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ Contains methods and attributes valid for Guardrails either created with CDK or

## Properties

### contentFiltersTier?

> `abstract` `optional` **contentFiltersTier**: `string`

The content filters tier of the guardrail.

#### Implementation of

[`IGuardrail`](../interfaces/IGuardrail.md).[`contentFiltersTier`](../interfaces/IGuardrail.md#contentfilterstier)

***

### env

> `readonly` **env**: `ResourceEnvironment`
Expand Down Expand Up @@ -85,6 +97,18 @@ The ARN of the guardrail.

***

### guardrailCrossRegionProfile?

> `abstract` `optional` **guardrailCrossRegionProfile**: `string`

The cross-region inference profile of the guardrail.

#### Implementation of

[`IGuardrail`](../interfaces/IGuardrail.md).[`guardrailCrossRegionProfile`](../interfaces/IGuardrail.md#guardrailcrossregionprofile)

***

### guardrailId

> `abstract` `readonly` **guardrailId**: `string`
Expand Down Expand Up @@ -182,6 +206,19 @@ The stack in which this resource is defined.

`Resource.stack`

***

### topicFiltersTier?

> `abstract` `optional` **topicFiltersTier**: `string`

The topic filters tier for the guardrail.
If not set, defaults to "CLASSIC"

#### Implementation of

[`IGuardrail`](../interfaces/IGuardrail.md).[`topicFiltersTier`](../interfaces/IGuardrail.md#topicfilterstier)

## Methods

### \_enableCrossEnvironment()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ Note, if one of

***

### contentFiltersTier?

> `readonly` `optional` **contentFiltersTier**: `string`

The content filter tier of the guardrail.

***

### contextualGroundingFilters?

> `readonly` `optional` **contextualGroundingFilters**: [`ContextualGroundingFilter`](ContextualGroundingFilter.md)[]
Expand All @@ -71,6 +79,14 @@ The description of the guardrail.

***

### guardrailCrossRegionProfile?

> `readonly` `optional` **guardrailCrossRegionProfile**: `string`

The cross-region inference profile of the guardrail.

***

### kmsKey?

> `readonly` `optional` **kmsKey**: `IKey`
Expand Down Expand Up @@ -117,6 +133,14 @@ The regular expression (regex) filters to apply to the guardrail.

***

### topicFiltersTier?

> `readonly` `optional` **topicFiltersTier**: `string`

The topic filters tier for the guardrail.

***

### wordFilters?

> `readonly` `optional` **wordFilters**: [`WordFilter`](WordFilter.md)[]
Expand Down
27 changes: 27 additions & 0 deletions apidocs/@cdklabs/namespaces/bedrock/interfaces/IGuardrail.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ Represents a Guardrail, either created with CDK or imported.

## Properties

### contentFiltersTier?

> `optional` **contentFiltersTier**: `string`

The content filters tier for the guardrail.
If not set, defaults to "CLASSIC"

***

### env

> `readonly` **env**: `ResourceEnvironment`
Expand Down Expand Up @@ -48,6 +57,15 @@ The ARN of the guardrail.

***

### guardrailCrossRegionProfile?

> `optional` **guardrailCrossRegionProfile**: `string`

The cross-region profile for the guardrail.
Required if the detection mode is set to "CONTEXTUAL"

***

### guardrailId

> `readonly` **guardrailId**: `string`
Expand Down Expand Up @@ -111,6 +129,15 @@ The stack in which this resource is defined.

`IResource.stack`

***

### topicFiltersTier?

> `optional` **topicFiltersTier**: `string`

The topic filters tier for the guardrail.
If not set, defaults to "CLASSIC"

## Methods

### applyRemovalPolicy()
Expand Down
11 changes: 6 additions & 5 deletions package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/cdk-lib/bedrock/guardrails/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ guardrail = bedrock.Guardrail(self, 'myGuardrails',
| piiFilters | PIIFilter[] | No | The PII filters to apply to the guardrail |
| regexFilters | RegexFilter[] | No | The regular expression (regex) filters to apply to the guardrail |
| contextualGroundingFilters | ContextualGroundingFilter[] | No | The contextual grounding filters to apply to the guardrail |
| crossRegionConfig | string | No | ARN of the cross-region inference profile for the guardrail. Required if contentFiltersTier is set to "STANDARD". |
| contentFiltersTier | string | No | Content filters tier. Can be "CLASSIC" (default) or "STANDARD". |
| topicFiltersTier | string | No | Topic filters tier. Can be "CLASSIC" (default) or "STANDARD". |

## Filter Types

Expand Down
Loading
Loading