Skip to content

Commit 87872ea

Browse files
author
EC2 Default User
committed
Add custom configuration path support and enhance HITL functionality
- Add CustomConfigPath parameter to allow users to specify custom S3 configuration files - Generalize HITL (Human-in-the-Loop) support from Pattern 1 only to Patterns 1 and 2 - Add conditional IAM permissions for custom config file access - Update configuration documentation to reflect new CustomConfigPath feature - Add chat with document resolver functionality - Downgrade Python runtime from 3.13 to 3.12 for compatibility - Add cost tracking columns to reporting database
1 parent 1590f28 commit 87872ea

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ The solution now supports specifying a custom configuration file location via th
3636
When deploying the stack, you can specify a custom configuration file:
3737

3838
```yaml
39-
CustomConfigPath: "s3://my-bucket/path/to/my-config.yaml"
39+
CustomConfigPath: "s3://my-bucket/custom-config/config.yaml"
4040
```
4141
4242
**Key Features:**
4343
- **Override Default Configuration**: When specified, your custom configuration completely replaces the default pattern configuration
44-
- **S3 URI Format**: Accepts standard S3 URI format (e.g., `s3://bucket-name/path/to/config.yaml`)
44+
- **S3 URI Format**: Accepts standard S3 URI format (e.g., `ss3://my-bucket/custom-config/config.yaml`)
4545
- **Least-Privilege Security**: IAM permissions are conditionally granted only to the specific S3 bucket and object you specify
4646
- **All Patterns Supported**: Works with Pattern 1 (BDA), Pattern 2 (Textract + Bedrock), and Pattern 3 (Textract + UDOP + Bedrock)
4747

@@ -131,7 +131,7 @@ Key parameters that can be configured during CloudFormation deployment:
131131
- `WAFAllowedIPv4Ranges`: IP restrictions for web UI access (default: allow all)
132132
- `CloudFrontPriceClass`: Set CloudFront price class for UI distribution
133133
- `CloudFrontAllowedGeos`: Optional geographic restrictions for UI access
134-
- `CustomConfigPath`: Optional S3 URI to a custom configuration file (e.g., s3://my-bucket/config.yaml)
134+
- `CustomConfigPath`: Optional S3 URI to a custom configuration file that overrides pattern presets. Leave blank to use selected pattern configuration. Example: s3://my-bucket/custom-config/config.yaml
135135

136136
### Pattern Selection
137137
- `IDPPattern`: Select processing pattern:

template.yaml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,8 @@ Parameters:
100100
AllowedValues:
101101
- "lending-package-sample"
102102
- "default"
103-
Description: >-
104-
Select the configuration preset for Pattern 1. Each configuration contains pre-tuned settings for specific document processing scenarios - see https://github.com/aws-samples/sample-genai-idp/blob/main/config_library/README.md.
105-
Note: This selected configuration will be replaced by the Custom Configuration Path if specified.
106-
107-
CustomConfigPath:
108-
Type: String
109-
Default: ""
110-
Description: Custom S3 path for configuration file (applicable to all patterns). For Example s3://your-bucket/path/to/config.yaml
111-
AllowedPattern: '^(|s3://[a-zA-Z0-9.\-_]+(/.*)?)'
112-
ConstraintDescription: Must be empty or a valid S3 URI (e.g., s3://my-bucket/my-key)
103+
Description: Select the configuration preset for Pattern 1. Each configuration contains pre-tuned settings for specific document processing scenarios - see https://github.com/aws-samples/sample-genai-idp/blob/main/config_library/README.md.
104+
Note: This selected configuration will be replaced by the Custom Configuration Path if specified.
113105

114106
# Pattern 2 Parameters
115107

@@ -122,9 +114,8 @@ Parameters:
122114
- "rvl-cdip-package-sample-with-few-shot-examples"
123115
- "bank-statement-sample"
124116
- "default"
125-
Description: >-
126-
Select the configuration preset for Pattern 2. Each configuration contains pre-tuned settings for specific document processing scenarios - see https://github.com/aws-samples/sample-genai-idp/blob/main/config_library/README.md.
127-
Note: This selected configuration will be replaced by the Custom Configuration Path if specified.
117+
Description: Select the configuration preset for Pattern 2. Each configuration contains pre-tuned settings for specific document processing scenarios see https://github.com/aws-samples/sample-genai-idp/blob/main/config_library/README.md.
118+
Note: Custom configuration overrides the selected pattern configuration when provided.
128119

129120
Pattern2CustomClassificationModelARN:
130121
Type: String
@@ -150,10 +141,8 @@ Parameters:
150141
AllowedValues:
151142
- "rvl-cdip-package-sample"
152143
- "default"
153-
Description: >-
154-
Select the configuration preset for Pattern 3. Each configuration contains pre-tuned settings for specific document processing scenarios - see https://github.com/aws-samples/sample-genai-idp/blob/main/config_library/README.md.
155-
Note: This selected configuration will be replaced by the Custom Configuration Path if specified.
156-
144+
Description: Select the configuration preset for Pattern 3. Each configuration contains pre-tuned settings for specific document processing scenarios - see https://github.com/aws-samples/sample-genai-idp/blob/main/config_library/README.md.
145+
Note: Custom configuration overrides the selected pattern configuration when provided.
157146
# HITL (A2I) Configuration
158147

159148
EnableHITL:
@@ -278,6 +267,13 @@ Parameters:
278267
If you provided a Bedrock Guardrail Id above, provide the corresponding Guardrail version here (e.g. DRAFT|1|2|...).
279268
280269
# General Configuration
270+
CustomConfigPath:
271+
Type: String
272+
Default: ""
273+
Description: S3 URI pointing to your custom configuration YAML file. When provided, this configuration overrides the selected pattern preset and applies to all processing patterns. Leave blank to use the selected pattern configuration preset. Example: s3://my-bucket/custom-config/config.yaml
274+
AllowedPattern: '^(|s3://[a-zA-Z0-9.\-_]+(/.*)?)'
275+
ConstraintDescription: Must be empty or a valid S3 URI (Example: s3://my-bucket/custom-config/config.yaml)
276+
281277
MaxConcurrentWorkflows:
282278
Type: Number
283279
Default: 100

0 commit comments

Comments
 (0)